Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android M request permission non activity

My widget makes calls to secure permissions outside of an Activity scope. Is it possible to request permissions for Android M outside of an Activity?

like image 866
Dave Honly Avatar asked Jul 19 '15 15:07

Dave Honly


People also ask

How do I request permission on Android?

Step 1: Declare the permission in the Android Manifest file: In Android, permissions are declared in the AndroidManifest. xml file using the uses-permission tag. Here we are declaring storage and camera permission.

How do I request permission?

How do you ask for permission in a formal letter? You have to make sure to use formal language in a permission letter. Specify the reason for which you are seeking permission clearly, and do not miss out any details. Be kind and polite in your writing.

How do I request permission in Android 11?

Request permissions If the permission is not granted, we need to ask for permission to access certain features like camera, storage, etc. To ask permission, we need to use ActivityCompat. requestPermission() method with the permission name and the request code.


1 Answers

No, it's not possible. What you can do is to send a notification where the user can tap and then use an activity to request/manage the permission (maybe with dialog theme).

like image 60
greywolf82 Avatar answered Oct 22 '22 06:10

greywolf82