6

When you use ACTION_OPEN_DOCUMENT_TREEto 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:

enter image description here

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:

enter image description here

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?

AndreaF
  • 11,975
  • 27
  • 102
  • 168
  • The only thing possible on Android 10 and 11 is opening in`external storage: primary partion` and `external storage: sd card`. – blackapps Sep 23 '20 at 15:21
  • @blackapps Do you mean as hint to `Intent.ACTION_OPEN_DOCUMENT_TREE`? – AndreaF Sep 23 '20 at 15:23
  • No. I just mean that if you use Intent.ACTION_OPEN_DOCUMENT_TREE you can let it open on those two partitions. Not in subfolders or something like that. – blackapps Sep 23 '20 at 15:25
  • @blackapps In what way? If I call `ACTION_OPEN_DOCUMENT_TREE` as shown in the question by default it's shown latest used path (not even selectable) rather than root of one of these partitions. – AndreaF Sep 23 '20 at 15:27
  • I have no code at hand at the moment. Tomorrow there is another day. – blackapps Sep 23 '20 at 15:28
  • @blackapps any update? :) – AndreaF Sep 24 '20 at 10:05
  • @AndreaF Did you ever get this problem fixed? I am dealing with the same thing. Any update(s) you have will be appreciated. Thank you. – Samko Feb 28 '21 at 01:05
  • any update?? I'm looking to find the solution of this . – Huy Nguyen Mar 23 '21 at 04:44

0 Answers0