Android Question Correct implement to OnActivityResult

i need to implement this OnActivityResult function on JavaIntent


@override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
String res="";
ziwiResponse zr=new ziwiResponse();
if (requestCode==0x0000978c){
if (data!=null && data.getStringExtra("ZIWIRESPONSE")!=null)
{
res=data.getStringExtra("ZIWIRESPONSE");
zr=zr.GetResponse(res);
Log.d("jj","" + res);
Log.d("jj","" + zr.getEVA());
}
}
}

but B4A tell me that onActivityResult is just declared on class "nameclass" but its not true, how can i implement this? i read that exist the sub named "Sub Activity_Result (requestCode As Int, resultCode As Int, data As Intent)" but not work.....pls help me
 
sorry but i I'm not really succeeding, i tried in this way

this is the code inside the #If JAVA
onActivityResult


@override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
String res="";
ziwiResponse zr=new ziwiResponse();
if (requestCode==0x0000978c){
if (data!=null && data.getStringExtra("ZIWIRESPONSE")!=null)
{
res=data.getStringExtra("ZIWIRESPONSE");
zr=zr.GetResponse(res);
Log.d("jj","" + res);
Log.d("jj","" + zr.getEVA());
}
}
}


public void TestBluetooth() {
// Chiamata per avviare la rilevazione con chiavetta Stitch
// Funzione Parametri -> GetEVA_Stitch(int IrDaSecurity, int IrDaPassword, int boudRate, boolean resetEVACounter)

// Utilizza la classe ziwiIntegrator
ziwiIntegrator ziwi = new ziwiIntegrator(this);
ziwi.GetEVA_Stitch(0, 0, ziwi.IRDABOUD_AUTO, true);
}



the code documentation says the following:

The response of function calls is provided in the onActivityResult method of the calling activity.

An example of usage is as follows:

@override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
String res="";
ziwiResponse zr=new ziwiResponse();
if (requestCode==0x0000978c){
if (data!=null && data.getStringExtra("ZIWIRESPONSE")!=null){
res=data.getStringExtra("ZIWIRESPONSE");
zr=zr.GetResponse(res);
Log.d("jj","" + res);
Log.d("jj","" + zr.getEVA());
}
}
}




attached the required documentation
 

Attachments

  • Integrazione rev 1.2.pdf
    152.6 KB · Views: 81
Upvote 0
Top