Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android在图像查看器中显示图像_Android_Image - Fatal编程技术网

Android在图像查看器中显示图像

Android在图像查看器中显示图像,android,image,Android,Image,我想在内置图像查看器中显示png。 这是我的密码: Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(path)), "image/png"); startActivity(intent); 它显示一个带有列表的msgbox,其中包含10多个可以显示图像的不同应用程序 如

我想在内置图像查看器中显示png。 这是我的密码:

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(path)), "image/png");
startActivity(intent);
它显示一个带有列表的msgbox,其中包含10多个可以显示图像的不同应用程序

如何将msgbox限制为两个或三个应用程序
可能吗?

我相信你做不到这一点,目的是让用户有自由决定使用什么打开它。

我不知道你为什么要这样做,你怎么知道留下什么应用程序让用户可以选择?对他/她来说最重要的是什么?如果你从列表中拿出你真正想要的东西会怎么样。@blindstuff用内置的Gallery打开菜单怎么样?你没想过吗?有了这样一个菜单,用户知道如果点击它会做什么。