[英]Open default Image Viewer
I have displayed a set of images in the list view, when I click one list item image, that specific image have to open in the default Image Viewer . 我在列表视图中显示了一组图像,当我单击一个列表项图像时,该特定图像必须在默认的图像查看器中打开。
When the click is made i taken that specific image and displayed in the imageview but for addition facilities like zoom all i have to open that Bitmap image in the default Image Viewer in android. 当点击进行时,我拍摄了该特定图像并显示在图像视图中,但是对于像缩放这样的附加设施,我必须在android中的默认图像查看器中打开该位图图像。
Can any one tell me possible answer. 任何人都可以告诉我可能的答案。 Thank you in advance.
先感谢您。
In listview on itemclick u just add this . 在itemclick的listview中你只需添加它。
File file = new File(itemList.get(position));
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("file://" + file.getAbsolutePath());
intent.setDataAndType(data, "image/*");
startActivity(intent);
in itemlist is your arraylist. 在项目列表中是你的arraylist。
By using this you can open default Image Viewer 使用此功能,您可以打开默认的图像查看器
Intent viewImageIntent = new Intent(android.content.Intent.ACTION_VIEW, uri);
startActivity(viewImageIntent);
You can save bitmap to file and show image this code : 您可以将位图保存到文件并显示此代码的图像:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + filepath), "image/*");
startActivity(intent);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.