我正在使用以下代码在我的应用程序内打开一个库
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, FIND_RESULT);
Run Code Online (Sandbox Code Playgroud)
是否可以限制图像列表仅显示相机拍摄的图像?在我的2.1系统上查看图库,图像被分组,因此必须有一个参数来定义它所属的文件夹.
检查MediaStore.Images.ImageColumns我没找到任何可以定义此类内容的列.
我可能错了吗?因为如果我可以创建一个按文件夹过滤的查询并创建我自己的图库视图,那么我的问题就会解决.
我正在使用以下代码打开Android默认图库应用程序.它会打开sdcard下的所有图像文件夹.我怎样才能打开一个特定的文件夹?
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, "Pick any photo"), SELECT_IMAGE_FROM_GALLERY_CONSTANT);
Run Code Online (Sandbox Code Playgroud) 我确信这是一个微不足道的问题,但我没有找到答案.
我正在制作一个Android应用程序,我想从中打开显示多个图像的图像查看器.我知道如何只使用一个图像:
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file1 = new File("/mnt/sdcard/photos/20397a.jpg");
intent.setDataAndType(Uri.fromFile(file1), "image/jpg");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
这非常有效.但是如何将几个图像传递给观众?
谢谢!!L.
我正在尝试使用意图查看特定文件夹中的图像。我的代码如下:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri imgUri = Uri.parse("file://sdcard/download");
intent.setDataAndType(imgUri, "image/*");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
但是,每次运行时,我都会在日志中收到此消息:
02-25 00:40:16.271:错误/(8359):无法打开'/下载
'02-25 00:40:16.271:错误/(8359):无法打开'/下载'
我究竟做错了什么?
可能重复:
带文件夹过滤器的图库
我正在使用以下代码在我的应用程序内打开一个库
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, TEST_RESULT);
Run Code Online (Sandbox Code Playgroud)
我需要使用内置图库应用程序来显示特定文件夹中的图像/视频列表. - 当图库打开时,有一些Intent动作显示所选图像??? - 有没有办法确定特定的图像文件夹?**我希望图库只显示我文件夹中的图像/视频(而不显示其他系统文件夹).