After Android8.0, open the file manager and jump to the specified path

String path = "%2fDCIM%2fCamera%2f";
Uri uri = Uri.parse("content://com.android.externalstorage.documents/document/primary:" + path);
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");//想要展示的文件类型
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, uri);
startActivityForResult(intent, 0);

PS: The normal file path is DCIM/Camera, where you need to replace / with %2f.

Guess you like

Origin blog.csdn.net/mozushixin_1/article/details/109223066