Android Question Problem with a return value. Do i miss something?


Licensed User
The above activity returns a value to the sender activity when finished but the return value doesn't match the updated value If Button_Click event is Asynchronous

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

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.
    Private Value As String = "foo"
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:

End Sub

Sub GetPermission(ActivityInstance As Object)
    Wait For Activity_Pause (UserClosed As Boolean)

    Log(Starter.rp.Check(Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE)) 'returns false even approved before
    Log(Value) ' Returns "foo", expected "bar"
    CallSubDelayed2(ActivityInstance, "ValidationComplete", Value)
End Sub

Sub Button1_Click

    'if i comment out the resumable method CheckAndRequest everything works as expected
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    Value = "bar"
End Sub

Sub Activity_Resume

End Sub
Last edited:


Licensed User
Because i want to guide the end user for the expecting request in a new activity with pictures and text. if the permission is already approved the activity will not start. i dont want it to do in the main activity (new panel) because i want to split the code in different activities
The problem is not the permission maybe is another resumable request in future. i can solve that problem checking the permission result back in the main activity there are a lot of solutions, a process global is a solution too or a variable in start module ... plus more

i didnt try bx4pages yet is something new for me now
Upvote 0