Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DelphiWorlds/75cdb97464142ff0c0c455c27c21d97e to your computer and use it in GitHub Desktop.
Save DelphiWorlds/75cdb97464142ff0c0c455c27c21d97e to your computer and use it in GitHub Desktop.
Code to show the manage external storage permissions settings (Android 11)
uses
Androidapi.Helpers, Androidapi.JNI.Provider, Androidapi.JNI.GraphicsContentViewText;
procedure ShowManageExternalStorageSettings;
var
LIntent: JIntent;
begin
LIntent := TJIntent.Create;
LIntent.setAction(StringToJString('android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION');
LIntent.setData(TJnet_Uri.JavaClass.parse(StringToJString('package:' + JStringtoString(TAndroidHelper.Context.getPackageName()))));
TAndroidHelper.Context.startActivity(LIntent);
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment