How to use Android StorageManager.PrimaryStorageVolume.CreateOpenDocumentTreeIntent? #17200
Unanswered
r2d2Proton
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to display an Android System dialog to install my app. Currently I have the following:
`
var service = MauiApplication.Current.GetSystemService(Context.StorageService);
Android.OS.Storage.StorageManager sm = service as Android.OS.Storage.StorageManager;
var primVol = sm.PrimaryStorageVolume;
var intent = primVol.CreateOpenDocumentTreeIntent();
intent.SetFlags(ActivityFlags.NewTask);
string startDir = "Documents";
Java.Lang.Object? result = intent.GetParcelableExtra("android.provider.extra.INITIAL_URI");
MauiApplication.Current.StartActivity(intent);
`
This shows the attached dialog at startup. I don't know how to wait for it to finish.
Beta Was this translation helpful? Give feedback.
All reactions