Android M Request Multiple permission at a single time

后端 未结 1 755
一整个雨季
一整个雨季 2021-01-21 14:40

Hi i am updating my application jaffna Temples . so that it can support Android M devices (v 6.0 and above).

Is there a way i can request multiple permission at a singl

相关标签:
1条回答
  • 2021-01-21 15:25

    Is there a way i can request multiple permission at a single time

    Put more than one permission in the String[] that you are passing to requestPermissions().

    For example, in this sample project, I define collections of permissions statically, such as:

      private static final String[] PERMS_TAKE_PICTURE={
        CAMERA,
        WRITE_EXTERNAL_STORAGE
      };
    

    so that I can request those permissions later:

    ActivityCompat.requestPermissions(this, PERMS_TAKE_PICTURE,
        RESULT_PERMS_INITIAL);
    
    0 讨论(0)
提交回复
热议问题