I start an application with this code:
Intent hasApp = getPackageManager().getLaunchIntentForPackage("appName.app");
Intent intent = new Intent(Intent.ACTION_VIEW);
dataId = response.getdataId();
intent.setData(Uri.parse("appName:?pid=" + dataId + "&action=returntoapp"));
startActivityForResult(intent, Globals.DATA_REQUEST_CODE);
And i close the opened application with this code:
setResult(Activity.RESULT_OK);
finish();
But when the first app called the onActivityResult() method I got the same requestCode, but the intent is null, and the resultCode is ACTIVITY_CANCELED.
I don't understand why.