2013-04-24 27 views
0

如何將內存從圖像視圖中存儲的前一個uri源映像視圖中清除出來? 這是到目前爲止我的代碼:如何從導致程序崩潰的imageview中清除uri image

ImageView a = (ImageView)findViewById(R.id.a); 
ImageView b=(ImageView)findViewById(R.id.b); 
ImageView c =(ImageView)findViewById(R.id.c); 


Uri topImage = Uri.parse(top); 
Uri bottomImage = Uri.parse(bottom); 
Uri fwImage = Uri.parse(fw); 

a.setImageURI(topImage); 
b.setImageURI(bottomImage); 
c.setImageURI(fwImage); 

回答

0

嘗試回收和設置空:

BitmapDrawable bd = (BitmapDrawable) iv.getDrawable(); 
bd.getBitmap().recycle(); 
iv.setImageDrawable(null);