我正在尝试使用本机图库打开我的应用程序拍摄的所有照片。
这是我的代码:
Intent intentBrowseFiles = new Intent(Intent.ACTION_VIEW);
intentBrowseFiles.setType("image/*");
Uri uri = Uri.parse(Environment.getExternalStorageDirectory() + "/DCIM/MyApp");
intentBrowseFiles.setData(uri);
intentBrowseFiles.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentBrowseFiles);
如果我不设置setData
画廊打开,但在根目录中,如果我设置,我的应用程序崩溃。
有没有办法在特定目录的图库中打开它?
无论如何,谢谢你!