Java Question onAcitivityResult

kkkpe

Active Member
Licensed User
Longtime User
The startActivityForResult method is launched from a java-inline library .. how to intercept the onActivityResult event in B4a?
 

Star-Dust

Expert
Licensed User
Longtime User
See this

And
 

kkkpe

Active Member
Licensed User
Longtime User
I tried with b4a and it does not start the intent

Dim i As Intent
i.Initialize(i.ACTION_MAIN,"")
i.SetComponent("sv.ziwi.external")
'i.SetPackage("sv.ziwi.external")
i.PutExtra("ACTION", "GetEVA_Stitch")
i.PutExtra("KEY", "" )
i.PutExtra("BOUDRATE", 112)
i.PutExtra("IRDA_SECURITY", 0)
i.PutExtra("IRDA_PASSWORD", 0)
i.PutExtra("CALLER_ID","b4a.example")
i.PutExtra("RESETEVACOUNTER",True)
StartActivityForResult(i)

I tried with javaobject and it opens the intent
I have this situation, with javaobject I launch the method and it works, now I should have the response intent
B4X:
dim jo as JavaObject
jo.InitializeNewInstance("b4a.example.main.ziwiIntegrator",Array(Null,GetActivity))
jo.RunMethod("GetEVA_Stitch",Array(0,0,112,True))

#if java
 public final AlertDialog GetEVA_Stitch(int IrDaSecurity, int IrDaPassword, int boudRate, boolean resetEVACounter) {
        Intent intentScan = new Intent(Intent.ACTION_MAIN);
        Intent intentSend;
        intentScan.addCategory(ZIWI_PACKAGE);

        ApplicationInfo targetAppPackage = findTargetAppPackage(intentScan);
        if (targetAppPackage == null) {
            return showDownloadDialog();
        }
        intentSend = new Intent("sv.ziwi.external");
        intentSend.putExtra("ACTION", "GetEVA_Stitch" );
        intentSend.putExtra("KEY", "" );
        intentSend.putExtra("BOUDRATE", boudRate);
        intentSend.putExtra("IRDA_SECURITY", IrDaSecurity);
        intentSend.putExtra("IRDA_PASSWORD", IrDaPassword);
        intentSend.putExtra("CALLER_ID",getApplicationName(mContext));
        intentSend.putExtra("RESETEVACOUNTER",resetEVACounter);
        startActivityForResult(intentSend , 0);
        return null;
    }

#end if
 
Top