Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
580 views
in Technique[技术] by (71.8m points)

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

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);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...