Android Question error permission READ_PHONE_STATE

Discussion in 'Android Questions' started by Roberto P., Aug 31, 2018.

  1. Roberto P.

    Roberto P. Well-Known Member Licensed User

    Hi,
    I've a problem when use below function:

    Code:
    Dim ph                         As PhoneId
         m_device_id                =    ph.GetDeviceId
    this is the code that I added to manifest

    Code:
    AddPermission(android.permission.READ_PHONE_STATE)
    thank in advance
    regards
     
  2. Mahares

    Mahares Well Known Member Licensed User

    Try to also add this code to your Activity_Resume:
    Code:
    Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_PHONE_STATE)  '
        Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
        
    If Result = False Then
            MsgboxAsync(
    "No permission to phone ID""")
            
    Return
        
    Else
            
    Log("Granted")
            
    Dim ph  As PhoneId
            
    Dim m_device_id  As String  = ph.GetDeviceId
            
    Log(m_device_id)  'will display phone ID
        End If
     
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice