代码如下:
//mPath实际路径是/storage/emulated/0/MyScreenRecorder/,这里只写后面那个就行
val mPath ="/MyScreenRecorder/"
val uri = Uri.parse("content://com.android.externalstorage.documents/document/primary:$mPath")
val i = Intent(Intent.ACTION_OPEN_DOCUMENT)
i.addCategory(Intent.CATEGORY_OPENABLE)
i.setType("*/*") //指定打开文件夹中能点击的文件类型
i.putExtra(DocumentsContract.EXTRA_INITIAL_URI,uri)
mContext.startActivity(i)