【发布时间】:2017-02-15 01:30:32
【问题描述】:
我有两个通过 android studio 创建的 android 应用程序。从application1,我尝试将图片发送到application2并查看它。
为此,我从应用程序 1 中通过意图将图像传递给应用程序 2,如下所示:
Intent imgIntent = new Intent();
imgIntent .setAction(Intent.ACTION_SEND);
Uri uriToImage = Uri.parse("android.resource://com.example.appname/" + R.drawable.pic_png);
imgIntent .putExtra(Intent.EXTRA_STREAM, uriToImage);
imgIntent .setType("image/*");//image/jpeg
startActivityForResult(imgIntent , REQUEST_CODE);
如何在 application2 中查看通过意图发送的图像? 如果我们发送一个文本,我们可以得到它:
getIntent().getExtras().getString("textvalue");
我是安卓平台的新手。请帮助我。在此先感谢...
【问题讨论】: