Passing bitmap to other activity getting message on logcat FAILED BINDER TRANSACTION

匆匆过客 提交于 2019-12-17 07:54:25

问题


when i'm passing bitmap image to other activity i'm getting mag on logcat as-

 03-20 12:06:56.553: E/JavaBinder(280): !!! FAILED BINDER TRANSACTION !!!

it's happening for large size image.small size image is working well. what should i do?please help me.thanks in advance.

here i'm passing data as-

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);

回答1:


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();


来源:https://stackoverflow.com/questions/15517176/passing-bitmap-to-other-activity-getting-message-on-logcat-failed-binder-transac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!