Search code examples
androidandroid-permissions

How do I request android runtime permissions the way like in image below?


I found an .apk file and laucnhed on emulator. On start it requests permissions via dialog I have never seen before. I want to create same dialog in my app but I can't find the way dialog below is implemented. I have read many questions on SO and explored some docs but that wasn't I'm looking for. Could you help me to implement request permissions dialog like on the picture? enter image description here


Solution

  • What you're seeing is permission screen for legacy apps that was added in android 10:

    If your app targets Android 5.1 (API level 22) or lower, users see a permissions screen when using your app on a device that runs Android 10 or higher for the first time, as shown in Figure 1. This screen gives users the opportunity to revoke access to permissions that the system previously granted to your app at install time.