Android Question SDK 26 multiple runtime permissions

Microinvest

Member
Licensed User
Longtime User
Hello there,

how to obtain multiple runtime permissions. For example I'm requesting permission for reading like this:

B4X:
      Dim rpStorage as RuntimePermissions       

      DefFolder = rpStorage.GetSafeDirDefaultExternal("")
      rpStorage.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)

     ....some lines below  
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
   If Permission = rpStorage.PERMISSION_WRITE_EXTERNAL_STORAGE Then     
     ..................  
   End If
End Sub

And everything works as charm. However I would like to use camera permission as well, yet if I write something like this below, Camera is not working (I never have the pop up asking me to allow Camera usage on first install, while for storage I have such pop up).

B4X:
      Dim rpStorage, rpCam as RuntimePermissions       

      DefFolder = rpStorage.GetSafeDirDefaultExternal("")
      rpStorage.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
      rpCam.CheckAndRequest(rp.PERMISSION_CAMERA)

     ....some lines below  
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
   If Permission = rpStorage.PERMISSION_WRITE_EXTERNAL_STORAGE Then     
     ..................  
   End If
   If Permission = rpCam.PERMISSION_CAMERA Then     
     ..................  
   End If
End Sub

How to deal with several runtime permissions in same time?
Thanks in Advance
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…