在 Android 的默认图库图像查看器中使用 URI 打开图像 [英] Open an image using URI in Android's default gallery image viewer

查看:27
本文介绍了在 Android 的默认图库图像查看器中使用 URI 打开图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经提取了图像 uri,现在我想使用 Android 的默认图像查看器打开图像.或者更好的是,用户可以选择使用什么程序来打开图像.如果您尝试打开文件,则文件资源管理器之类的东西会为您提供.

I have extracted image uri, now I would like to open image with Android's default image viewer. Or even better, user could choose what program to use to open the image. Something like File Explorers offer you if you try to open a file.

推荐答案

问自己,也回答自己:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("content://media/external/images/media/16"))); /** replace with your own uri */

它还会询问使用什么程序来查看文件.

It will also ask what program to use to view the file.

这篇关于在 Android 的默认图库图像查看器中使用 URI 打开图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆