How can I customize permission dialog in Android?

前端 未结 3 1256
自闭症患者
自闭症患者 2020-12-03 06:26

Suppose I request a permission at runtime like the following:

ActivityCompat.requestPermissions(thisActivity,
            new String[]{Manifest.permission.RE         


        
3条回答
  •  半阙折子戏
    2020-12-03 07:15

    The short answer is, you can't.

    As android documentation puts:

    When your app calls requestPermissions(), the system shows a standard dialog box to the user. Your app cannot configure or alter that dialog box. If you need to provide any information or explanation to the user, you should do that before you call requestPermissions(), as described in "Explain why the app needs permissions".

    So, there is no way to define a custom layout for the permission dialog for now.

    You can find more detailed information here: http://developer.android.com/training/permissions/requesting.html

提交回复
热议问题