2

当我将位图图像传递给其他活动时,我在 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);
4

1 回答 1

2

Putting that amount of data in extras is not a good approach. Easiest work around is keep a static reference of the new Bitmap

public static Bitmap getBitmap(Bitmap changeBitmap){
return bitmap;
} 

And after using it recyle it i this manner.

if(changedBitmap!=origanlBitmap)
orignalBitmap.recycle();
于 2013-03-20T07:05:43.010 回答