Android Question Show Request permission screen after user selecting Don't Show this again

shasunder

Member
Licensed User
Longtime User
How to show dialog to the user to change settings to allow app to make and manage calls after the user selects "Don't ask again"

I am trying to show the permission dialog even if the user selects "Don't ask again" when they click a button using the below code. But this doesn't seem to work. Please help

Dim context As JavaObject
context.InitializeStatic("anywheresoftware.b4a.BA")
context = context.GetField("applicationContext")
Dim settings As JavaObject
settings.InitializeStatic("android.provider.Settings.System")
settings.RunMethod("putInt", Array As Object(context.RunMethod("getContentResolver", Null), _
"READ_PHONE_STATE", 1 ))
 

Attachments

  • allow.png
    allow.png
    26.3 KB · Views: 374

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

How to show dialog to the user to change settings to allow app to make and manage calls after the user selects "Don't ask again"
It is not possible to show the dialog. You need to ask the user to enable the permission in the device settings.
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
You can help user to change settings. For example,
B4X:
Dim Intent As Intent
Intent.Initialize ("android.settings.APPLICATION_DETAILS_SETTINGS", "package:" & Application.PackageName)
StartActivity(Intent)
 
Upvote 0

shasunder

Member
Licensed User
Longtime User
Semen Matusovskiy, you are right. But using your code, the user should click on permissions to go to that screen. I am looking for an option to go to App Permissions screen directly.
 
Last edited:
Upvote 0
Top