如何使用默认库应用程序来查看存储在绘制文件夹的图像?如何使用、应用程序、文件夹、图像

2023-09-04 03:22:04 作者:孑然一身

要做到这一点,我用下面的code,但它抛出ActivityNotFoundException ...

 字符串uriStr =android.resource://+com.soft.usegallery+/+ R.drawable.icon;
                 开放的我们的uri = Uri.parse(uriStr);
                 意向意图=新的意图();
                   intent.setAction(Intent.ACTION_VIEW);
                   intent.setDataAndType(URI,图像/ *);
                   startActivity(意向);
 

解决方案

首先,没有单一的默认库的应用程序为Android。不同的设备可能包含不同的画廊的应用程序,有的可能没有这样的应用程序。

二,很少,如果有的话,应用程序支持 android.resource:// 方案,更何况是一个画廊的应用程序

如何将新应用程序直接发送到iPhone上的应用程序库

请实现自己的图像浏览界面,多半是使用的GridView

To do so I'm using the following code but it Throws ActivityNotFoundException...

String uriStr = "android.resource://"+ "com.soft.usegallery"+ "/" +  R.drawable.icon;
                 Uri uri = Uri.parse(uriStr);
                 Intent intent = new Intent();
                   intent.setAction(Intent.ACTION_VIEW);
                   intent.setDataAndType(uri, "image/*");
                   startActivity(intent);   

解决方案

First, there is no single "default gallery app" for Android. Different devices will contain different "gallery apps", and some probably have no such app.

Second, few, if any, apps support the android.resource:// scheme, let alone a "gallery app".

Please implement your own image viewing UI, perhaps using a GridView.