【发布时间】:2017-11-28 03:12:07
【问题描述】:
我有一个网格视图,它显示用户下载到 SD 卡文件夹中的图像。图像的变化取决于用户决定下载并保存到应用程序文件夹的内容。现在我的问题是我如何使用 android stock 或默认图库打开我点击的图像。我正在使用下面的代码。如何获取我单击的图像视图的图像路径并使用它来打开该特定图像?
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(filePath)), "image/*");
startActivity(intent);
请帮忙。
【问题讨论】:
-
有人帮帮我。
标签: image click gallery default