Android Question Unexpected event (missing RaiseSynchronousEvents): ion_event

kkkpe

Active Member
Licensed User
Longtime User
I can't understand why this error returns to me.
Anyone help me?

B4X:
Sub chiamapaytec(nomedevice As String)
    Dim i As Intent
    
    'Dim pm As PackageManager
    'i = pm.GetApplicationIntent("it.paytec.payddcmp")

    i.Initialize(i.ACTION_MAIN,"")
    i.SetComponent("it.paytec.payddcmp/.it.paytec.payddcmp.MainActivity")
    i.PutExtra("BT_6000_DEVICE_NAME","")
    i.PutExtra("MAX_BAUD","115200")
    i.PutExtra("PASSWORD","")
    i.PutExtra("DUMP",True)
    i.PutExtra("MODE",0)
    i.PutExtra("TITLE_MSG","Prelievo Audit")
    i.PutExtra("OPEN_BT_MSG","Apertura porta comunincazione")
    i.PutExtra("INIT_LINK_MSG","connessione con il sistema")
    i.PutExtra("READING_DATA_MSG","Lettura dati in corso")
    i.PutExtra("SHOW_PROGRESS_DIALOG",True)
    StartActivityForResult(i)
End Sub


Sub StartActivityForResult(i As Intent)
    Dim jo As JavaObject = GetBA
    ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null)
    jo.RunMethod("startActivityForResult", Array As Object(ion, i))
End Sub

Sub GetBA As Object
    Dim jo As JavaObject
    Dim cls As String = Me
    cls = cls.SubString("class ".Length)
    jo.InitializeStatic(cls)
    Return jo.GetField("processBA")
End Sub

Sub ion_Event (MethodName As String, Args() As Object) As Object
    'Args(0) = resultCode
    'Args(1) = intent
    Return Null
End Sub
 

kkkpe

Active Member
Licensed User
Longtime User
Ok. it works. the package name is wrong, I replaced it with
it.paytec.payddcmp/it.paytec.payddcmp.MainActivity
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…