Android Question [Solved: Multiple Variables With Same Name] Msgbox_Result Bug

LWGShane

Well-Known Member
Licensed User
Longtime User
When I try to use "Wait For Msgbox_Result (Result As Int)" and "Wait For (SF) Msgbox_Result (Result As Int)" the error logs display a "current declaration does not match previous one. result" Error.

Update: I have tried using BD.Show() and even that causes the declaration error.
 
Last edited:
which example you are talking about?

That what you described sounds like a coding mistake instead of a bug.

do you have another variable Result but with a different type than Int?
 
Upvote 0
which example you are talking about?

That what you described sounds like a coding mistake instead of a bug.

do you have another variable Result but with a different type than Int?

Yep, there was another variable named "Result".

B4X: Copy
Sub CheckPermissions
    RP.CheckAndRequest(RP.PERMISSION_WRITE_EXTERNAL_STORAGE)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result Then
        Starter.DB.Initialize
        Starter.AM.Initialize("...", "https://members.leftwinggamers.com/api")
    Else
        Wait For (BD.Show("I need permission to write to your Android device!", "Retry", "", "Cancel")) Complete (Result As Int)
    End If   
End Sub
 
Upvote 0
this should work

B4X: Copy
Sub CheckPermissions
    RP.CheckAndRequest(RP.PERMISSION_WRITE_EXTERNAL_STORAGE)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result Then
        Starter.DB.Initialize
        Starter.AM.Initialize("...", "https://members.leftwinggamers.com/api")
    Else
        Wait For (BD.Show("I need permission to write to your Android device!", "Retry", "", "Cancel")) Complete (Result2 As Int)
    End If  
End Sub

Note to use the Result2 after the last wait for if needed...
 
Upvote 0
Back
Top