Issues traversing through directory hierarchy with Android Storage Access Framework / DocumentProvider using MTP

前端 未结 3 429
名媛妹妹
名媛妹妹 2020-12-11 20:47

UPDATE: My initial question may be misleading so I want to rephrase it: I want to traverse through the hierarchy tree from an MTP connected device through Android\'s Storage

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 21:04

    The flags added before start activity for result do nothing.

    I do not understand that you use DocumentsContract. The user picks a directory. From the uri you get you can construct a DocumentFile for that directory.

    After that use DocumentFile::listFiles() on that instance to get a list of subdirectories and files.

提交回复
热议问题