当我将位图图像传递给其他活动时,我在 logcat 上收到 mag-
03-20 12:06:56.553: E/JavaBinder(280): !!! FAILED BINDER TRANSACTION !!!
它发生在大尺寸图像上。小尺寸图像运行良好。
我该怎么办?请帮助我。提前致谢。
在这里我将数据传递为-
Drawable drbl=_imageView.getDrawable();
int imageh=_imageView.getHeight();
int imagew=_imageView.getWidth();
Bitmap bit = ((BitmapDrawable)drbl).getBitmap();
intent.putExtra("Image_Height", imageh);
intent.putExtra("Image_Width", imagew);
intent.putExtra("Bitmap",bit);
startActivityForResult(intent, 2);
将这些数据量放入extras这不是一个好方法。最简单的解决方法是保留新位图的静态引用
public static Bitmap getBitmap(Bitmap changeBitmap){
return bitmap;
}
使用后以这种方式回收。
if(changedBitmap!=origanlBitmap)
orignalBitmap.recycle();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)