Hi All,
I use the ionactivityresult with success, but now I should like to add my own requestcode.
Is it possible?
Thanks
Steven
I use the ionactivityresult with success, but now I should like to add my own requestcode.
B4X:
ion = new IOnActivityResult() {
@Override
public void ResultArrived(int resultCode, Intent data) {
pResultArrived("storenewcard", resultCode, data);
};
};
BA.Log("myPOSStoreNewCard 5");
try {
ba.startActivityForResult(ion, null); //<-- passing null instead of an intent
} catch (NullPointerException npe) {
//required...
}
BA.SharedProcessBA sba = ba.sharedProcessBA;
try {
Field f = BA.SharedProcessBA.class.getDeclaredField("onActivityResultCode");
f.setAccessible(true);
requestCode = f.getInt(sba) - 1;
//requestCode holds the value that should be used to send the intent.
} catch (Exception e) {
throw new RuntimeException(e);
}
ba.startActivityForResult(ion, intent);
//startActivityForResult(intent, MyPos.REQUEST_CODE_STORE_CARD); <--this should be done
Thanks
Steven