问题
When you use ACTION_OPEN_DOCUMENT_TREE
to pick the permission to a path where to store files in Android 11, the default Android content manager by default opens on a recently used path and the button "USE THIS FOLDER" for some reason doesn't even appear at all, even if this path is an accessible path, unless the user manually move through paths to go to a suitable position (or returns in the path opened by default moving through directories if this is a selectable position).
E.g. Assume the latest path used by an user was Documents. When I ask the user to select a path where to allow the app to save the files, with
Intent i = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
i.addCategory(Intent.CATEGORY_DEFAULT);
this is what appears:
As you can see there is no "USE THIS FOLDER" blue button.
Now if the user select the superfolder path from here and enter again in Documents this is what He sees:
Now the "USE THIS FOLDER" button is available.
This is totally senseless and it's dreadful for the user experience, and many users certainly end up uninstalling the app bothered and confused.
Am I doing something wrong?
Is possible to pass to the intent some hint in order to open the content manager ACTION_OPEN_DOCUMENT_TREE
view directly in a specific path available in all Android devices storage (e.g. Documents) with the "USE THIS FOLDER" button available on the opening of the chooser?
来源:https://stackoverflow.com/questions/64031094/how-to-hint-content-manager-chooser-to-open-directly-on-a-selectable-position-wi