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

查看:465
本文介绍了在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.

推荐答案

问我自己,也要回答我自己:

Ask myself, answer myself also:

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天全站免登陆