如何发送包含绘制对象从一个android的活动到另一个使用意图的对象? [英] How to send an object containing drawable objects from one android activity to another using intents?

查看:111
本文介绍了如何发送包含绘制对象从一个android的活动到另一个使用意图的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过了这个:<一href=\"http://stackoverflow.com/questions/2139134/how-to-send-an-object-from-one-android-activity-to-another-using-intents\">How从一个Android的活动发送对象到另一个使用意图?

但我在对象发送图像到其他活动所面临的问题。

But i'm facing problem in sending images in the object to the other activity.

请帮忙。

推荐答案

将您绘制对象为位图,并将其发送到另一个活动。

Convert your Drawable to Bitmap and send it to Another Activity.

Bitmap bitmap = ((BitmapDrawable)d).getBitmap();

要发送,

intent.putExtra("Bitmap", bitmap);

要取,

Bitmap bitmap = (Bitmap)this.getIntent().getParcelableExtra("Bitmap");

这篇关于如何发送包含绘制对象从一个android的活动到另一个使用意图的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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