位图传递到其他活动得到消息logcat的失败粘结剂交易 [英] Passing bitmap to other activity getting message on logcat FAILED BINDER TRANSACTION

查看:133
本文介绍了位图传递到其他活动得到消息logcat的失败粘结剂交易的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我路过位图图像其他活动我越来越MAG上的logcat为 -

 十二月3号至20日:06:56.553:E / JavaBinder(280):!!!失败粘结剂交易!
 

它的发生的大尺寸image.small尺寸图像运作良好。 我应该怎么办?请帮助me.thanks提前。

在这里,我传递数据 -

 绘制对象DRBL = _imageView.getDrawable();
    INT imageh = _imageView.getHeight();
    INT imagew = _imageView.getWidth();
    位图位=((BitmapDrawable)DRBL).getBitmap();
    intent.putExtra(IMAGE_HEIGHT,imageh);
    intent.putExtra(IMAGE_WIDTH,imagew);
    intent.putExtra(位图,位);
    startActivityForResult(意向,2);
 

解决方案

把数据量中的其他是不是一个好方法。最简单的解决办法是让新位图的静态参考

 公共静态位图getBitmap(位图changeBitmap){
返回的位图;
}
 

和使用后recyle它,我这种方式。

 如果(changedBitmap!= origanlBitmap)
orignalBitmap.recycle();
 

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

解决方案

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

这篇关于位图传递到其他活动得到消息logcat的失败粘结剂交易的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆