2013-04-24 80 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);