Android Question Request Permissions Android 6+ ??

ilan

Expert
Licensed User
Longtime User
hi

i would like to request all dangerous permissions on activity start.
some actions (like phonestate) are called via service that is running in the background and i dont want
to ask there to allow a permission.

is it possible to ask for all dangerous permissions an app start?

do i have to store the user choice (allow|not allowed) or does the lib store it automatically somewhere?

thanx
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You cannot call RuntimePermissions.CheckAndRequest from a service as it is not possible to show any UI from a service. You can request all permissions from the main activity.

do i have to store the user choice (allow|not allowed) or does the lib store it automatically somewhere?
No. This is managed by the OS. If the user has already grant the relevant permission then the PermissionResult will be raised immediately.
 
Upvote 0
Top