【问题标题】:Android Universal Image Loader IntentAndroid 通用图像加载器意图
【发布时间】:2016-05-31 08:25:10
【问题描述】:

我正在使用通用图像加载器将图像绑定到我的列表视图中的 ImageView。这些图像是在异步绑定时从在线 url 获取的。现在我想通过单击 ImageView 打开图像。如何调用将处理显示图像的意图。我想在用户的默认图像查看器应用程序中显示使用通用图像加载器加载的图像。我有以下代码可以打开设备上的任何图像:

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri imgUri = Uri.parse("file://" + yourfilepath);
intent.setDataAndType(imgUri, "image/*");
startActivity(intent);

【问题讨论】:

  • 检查this
  • @Nisarg 我不想分享图片,我想在图库中打开图片。

标签: android android-intent universal-image-loader


【解决方案1】:

Gallery 应用程序不接受图像的 URL 作为 Intent 的一部分。您需要先保存图像。然后您可以使用以下方式启动默认图像查看器:

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + "/sdcard/abc.jpg"), "image/*");
startActivity(intent);

【讨论】:

    猜你喜欢
    • 2017-04-07
    • 2016-06-23
    • 2012-12-01
    • 1970-01-01
    • 2015-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多