我想要的图像从一个活动转移到另一 [英] I want to transfer the image from one activity to another

查看:94
本文介绍了我想要的图像从一个活动转移到另一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将图像从一个活动转移到另一个。在第一个活动的用户选择图像出几个图像从滚动视图的,并且图像具有要显示在下一个活动的imageview的。帮助必需的。

I have to transfer the image from one activity to another. In first activity the user selects the image out of several images from scroll view and that image has to be displayed in the imageview of next activity. Help required.

推荐答案

在你的第一个活动。

转换的ImageView以位图

Convert ImageView to Bitmap

    imageView.buildDrawingCache();
    Bitmap bitmap = imageView.getDrawingCache();

    Intent intent = new Intent(this, NewActivity.class);
    intent.putExtra("BitmapImage", bitmap);

在第二个活动

     Bitmap bitmap = (Bitmap) intent.getParcelableExtra("BitmapImage");

然后在ImageView的显示位图。

Then display bitmap in ImageView.

这篇关于我想要的图像从一个活动转移到另一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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