【问题标题】:gallery intent open the clicked image画廊意图打开点击的图像
【发布时间】: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


【解决方案1】:

ACTION_VIEW 更改为ACTION_PICK

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-13
    • 1970-01-01
    • 2011-09-29
    相关资源
    最近更新 更多