在android应用程序中查看通过intent发送的jpeg图像
我有两个通过android studio创建的android应用程序。从application1,我尝试将图片发送到application2并查看它 为此,我从app1 one通过intent将图像传递给application2,如下所示:在android应用程序中查看通过intent发送的jpeg图像,android,android-intent,Android,Android Intent,我有两个通过android studio创建的android应用程序。从application1,我尝试将图片发送到application2并查看它 为此,我从app1 one通过intent将图像传递给application2,如下所示: Intent imgIntent = new Intent(); imgIntent .setAction(Intent.ACTION_SEND); Uri uriToImage = Uri.parse("android.resource://com.exa
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中查看通过intent发送的图像?
如果我们发送文本,我们可以通过以下方式获取:
getIntent().getExtras().getString(“textvalue”)代码>
我是安卓平台的新手。请帮帮我,先谢谢你
Uri stream=(Uri)getIntent().getParcelableExtra(Intent.EXTRA_STREAM);
然后,将该Uri
传递给您最喜欢的图像加载库,如毕加索。检查并