Can somebody tell my why the Intent data
is always null?
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Posting here as a possible answer though may not be your issue exactly
Ensure your activity returning passes back something like this:
Intent returnIntent = new
returnIntent.putExtra("result", app);
returnIntent.putExtra("element", element);
if (app.getStatus() == 2){
returnIntent.putExtra("update", true);
// Tell the parent that everything went okay
setResult(Activity.RESULT_OK, returnIntent);
Log.i(TAG, "Returning, Result Success");
} else {
// Tell parent that nothing changed
setResult(RESULT_CANCELED, returnIntent);
Log.i(TAG, "Returning, Nothing changed");
}
finish();
I spent a long time suffering from null intents being returned. For me it was because in onBackPressed I was calling super.onBackPressed() before the above code. When I put it after everything worked great. If onStop/onDestroy is called too early the opportunity to pass an intent back is blocked. This may be your issue