Bug? Runtimepermissions: request for permission not shown

Discussion in 'Bugs & wishlist' started by dcoun, Jul 12, 2018 at 2:51 PM.

Thread Status:
Not open for further replies.
  1. dcoun

    dcoun Member Licensed User

    B4A v8.3 following the thread:https://www.b4x.com/android/forum/threads/endless-loop-in-check-permission.95015/ I arrived here:

    The following code works ok when compiled in debug mode, prompting for the permission and returning true when accepting in the prompting dialog.

    In Release mode nothing (requesting permission) is shown and false is returned.

    Same results in both a lenovo android v6.01 and an lineageOS android 8.1
    In applications permissions in Settings, no permissions where requested for this app. Compiled in debug mode and answering "yes" in the permission request prompt, this can change to yes for accessing external storage.

    Code:
    #Region  Project Attributes
        
    #ApplicationLabel: B4A Example
        
    #VersionCode: 1
        
    #VersionName:
        
    'SupportedOrientations possible values: unspecified, landscape or portrait.
        #SupportedOrientations: unspecified
        
    #CanInstallToExternalStorage: False
        
    #BridgeLogger: True
    #End Region

    #Region  Activity Attributes
        
    #FullScreen: False
        
    #IncludeTitle: True
    #End Region

    Sub Process_Globals
        
    'These global variables will be declared once when the application starts.
        'These variables can be accessed from all modules.
        Dim rr As RuntimePermissions
        
    Dim all As Int
    End Sub

    Sub Globals
        
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
    End Sub

    Sub Activity_Create(FirstTime As Boolean)  
        
    'Do not forget to load the layout file created with the visual designer. For example:
        'Activity.LoadLayout("Layout1")
        all=0
    End Sub

    Sub Activity_Resume
        
    If all =0 Then CallSubDelayed(Me,"soupa")
       
    End Sub

    Sub soupa
            all=all+
    1
            rr.CheckAndRequest(rr.PERMISSION_READ_EXTERNAL_STORAGE)
            
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
            
    Log("perm: "&Result)
            
    If Result Then all=all+1
    End Sub

    Sub Activity_Pause (UserClosed As Boolean)

    End Sub
    The manifest:
    Any support is welcome
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Please upload a small project that demonstrates it.
     
  3. Filippo

    Filippo Expert Licensed User

    please change your code like that
    Code:
    Sub Activity_Resume
        
    If rr.check.... Then CallSubDelayed(Me,"soupa")
      
    End Sub
     
  4. dcoun

    dcoun Member Licensed User

    The uploaded file is too large....
    You have email
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Your code is wrong. There is no bug here. You shouldn't have posted this bug report at all and instead allowed me to help you in the other thread you started.

    If you have any question then start a new thread in the questions forum.
     
Thread Status:
Not open for further replies.
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