Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.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中使用gallery应用程序显示图像_Android_Image_Android Gallery - Fatal编程技术网

无法在android中使用gallery应用程序显示图像

无法在android中使用gallery应用程序显示图像,android,image,android-gallery,Android,Image,Android Gallery,我想用gallery应用程序打开我的图像,但显示此错误 无法生成缩略图 我的代码: Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(Environment.getExternalStorageDirectory().getPath()+"/Connection/Picture/"+listItems.get(position)), "

我想用gallery应用程序打开我的图像,但显示此错误

无法生成缩略图

我的代码:

  Intent intent = new Intent();
  intent.setAction(Intent.ACTION_VIEW);
  intent.setDataAndType(Uri.parse(Environment.getExternalStorageDirectory().getPath()+"/Connection/Picture/"+listItems.get(position)), "image/*");
  startActivity(intent);
有没有其他方法可以用默认的android应用程序显示图像

注意:

1.当我使用文件管理器打开它时,它会成功打开

2.当我使用我的应用程序打开图像时,如果我选择另一个应用程序打开它,它将成功打开

3.“listItems.get(position)”是imagename示例“2361386837.jpg”


你能帮我吗?

没有人知道列表项。获取(位置)传递的是什么。所以没人知道你想从哪个目录下载照片。发布更好的示例。至少告诉我们完整路径。get(position)是图像的名称,例如“3784872245.jpg”,我有时会遇到同样的问题。。我的建议是创建您自己的图库活动。那么您希望图库使用该代码显示什么?只有一张图片?没有人知道listItems.get(position)提供了什么。所以没人知道你想从哪个目录下载照片。发布更好的示例。至少告诉我们完整路径。get(position)是图像的名称,例如“3784872245.jpg”,我有时会遇到同样的问题。。我的建议是创建您自己的图库活动。那么您希望图库使用该代码显示什么?只有一张照片?