简体   繁体   English

Android Universal Image Loader意图

[英]Android Universal Image Loader Intent

I am using Universal image Loader to bind images to ImageView inside my listview. 我正在使用通用图像加载器将图像绑定到列表视图中的ImageView。 These images are being fetched from online url at time of binding asynchronously. 这些图片是在异步绑定时从在线url中获取的。 Now i want to open the image on click of ImageView. 现在,我想单击ImageView打开图像。 How can I call intent that will handle displaying the Image. 我如何调用意图来处理显示图像。 I'd like to display the image loaded using Universal image Loader in user's default image viewer app . 我想在用户的默认图像查看器应用程序中显示使用Universal Image Loader加载的图像 I have the below code that opens any image on the device : 我有以下代码可以打开设备上的任何图像:

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

Gallery application does not accept URL for an image as part of the Intent. Gallery应用程序不接受图像的URL作为Intent的一部分。 You need to save the image first. 您需要先保存图像。 Then you can launch the default image viewer with something like this: 然后,您可以使用以下内容启动默认的图像查看器:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM