Android Question [SOLVED] ion_event: how to get a result?

rosippc64a

Active Member
Licensed User
Longtime User
Hi All,
I have to call an external app in my android device. I can call it, I can give param to it and I can get result from it, but I can't figure it, how to get the relevant info from it. I show:
1639481381677.png

My code (trying...)
B4X:
private Sub ion_Event (MethodName As String, Args() As Object) As Object
    'Args(0) = resultCode
    'Args(1) = intent
    Log($"Methodname=${MethodName}args(0)=${Args(0)} args(1)=${Args(1)}"$)
    If Args(0) = 0 Then 'resultCode = RESULT_OK
        Dim i As Intent = Args(1)
        Dim jo As JavaObject = i
        Dim uri As String = jo.RunMethod("getParcelableExtra", _
       Array As Object("com.postechnika.DirectPay.result"))
        Log(uri)
    End If
    Return Null
End Sub
The uri is null. If I change uri to map, then it will be uninitialized. I think that mMap isn't a map, but what?
thanks in advance
Steven
 

rosippc64a

Active Member
Licensed User
Longtime User
Ok, here is the solution:
B4X:
private Sub ion_Event (MethodName As String, Args() As Object) As Object
    'Args(0) = resultCode
    'Args(1) = intent
    Log($"Methodname=${MethodName}args(0)=${Args(0)} args(1)=${Args(1)}"$)
    If Args(0) = 0 Then 'resultCode = RESULT_OK
        Dim i As Intent = Args(1)
        Log(i.GetExtra("com.postechnika.DirectPay.result"))
        'Canceled
    End If
    Return Null
End Sub
 
Upvote 0
Top