I have two activities: activity_main
and activity_takeapicture
. I start an intent from activity_main
and the other activity takes a picture. Then activity_takeapicture
sends another intent with the file back to activity_main
. In activity_main
should I use onActivityResult
method to catch the intent sent by activity_takeapicture
and subsequently receive the data? Here is the part that sends the intent in activity_main
:
Intent intent = new Intent(this, DisplayResult.class);
startActivity(intent);
And here is 'activity_takeapicture`:
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(Intent.EXTRA_STREAM, pictureFile);
startActivity(intent);
EDIT: I have tried what you guys said, but now onActivityResult
doesn't fire when the activity_takeapicture
returns the intent back. How do I fix that?