[英]Open a specific folder (not a image) in Gallery in Android Studio
I write this code which open gallery with all folder:我写了这段代码,用所有文件夹打开画廊:
{
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setType("image/*");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
But I want to open an specific folder with built-in Gallery.但我想打开一个带有内置图库的特定文件夹。 I search about this and I found some people posted about this problem in stack overflow but there was no perfect sollution in any post.
我搜索了这个,我发现有些人在堆栈溢出中发布了关于这个问题的帖子,但在任何帖子中都没有完美的解决方案。 Can anyone help me?
谁能帮我?
The location of photos is always the same - it's the DCIM/Camera folder.照片的位置总是相同的——它是 DCIM/Camera 文件夹。 The full path looks like this:
完整路径如下所示:
OR by code.或通过代码。
private static String getGalleryPath() {
return photoDir = Environment.getExternalStorageDirectory() + "/" + Environment.DIRECTORY_DCIM + "/";
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.