要做到这一点,我用下面的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://
方案,更何况是一个画廊的应用程序
请实现自己的图像浏览界面,多半是使用的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
.
上一篇:Android模拟器:无法拉选择法拉、模拟器、Android
下一篇:对于动态添加ToolStripItems变化的ToolStripPanel溢出行为行为、动态、ToolStripItems、ToolStripPanel