Please I am looking for a way to request (Manage_External_Storage) Permission in Xamarin.Android because i need this permission in my app after android 11
Asked
Active
Viewed 1,188 times
1
-
Why do you need this permission at all? Are you just trying to read/write to external storage? – Cheesebaron Dec 14 '21 at 19:35
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 21 '21 at 10:02
1 Answers
1
This permission is about accessing all the files. At first, the permission should be added to the AndroidManifest.xms.And then you can use the following code to request the permission. In addition, you can request the write and read external peimissoin and add them in the Manifest.xml.
if (!Android.OS.Environment.IsExternalStorageManager)
{
Intent intent = new Intent();
intent.SetAction(Android.Provider.Settings.ActionManageAppAllFilesAccessPermission);
Android.Net.Uri uri = Android.Net.Uri.FromParts("package", this.PackageName, null);
intent.SetData(uri);
StartActivity(intent);
}

Liyun Zhang - MSFT
- 8,271
- 1
- 2
- 14