Android通用图像加载器意图

Android通用图像加载器意图

问题描述:

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

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

检查[这](http://stackoverflow.com/a/29788893/3117966) – Nisarg

+0

@Nisarg我不想分享图像,我:那你可以像这样启动默认的图片浏览器d喜欢在画廊中打开图像。 –

图库应用程序不接受作为Intent一部分的图像的URL。您需要先保存图像。

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