Read Extras from Intent MediaStore.ACTION_IMAGE_CAPTURE
1) If I try to pass extra data to Intent
to another activity like this:
Intent intent = new Intent(mContext, NoteActivity.class);
intent.putExtra(LIFE_ENTRY_NOTE, mEntry.getNote());
intent.putExtra(LIFE_ENTRY开发者_开发问答_ID, mEntry.get_ID());
Then it works fine and I am able to read this via data.getExtras().getString(CubbieButton.LIFE_ENTRY_NOTE)
2) But if I create intent like this:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(LIFE_ENTRY_ID, mEntry.get_ID());
I am NOT able to read it via data.getExtras().getString(CubbieButton.LIFE_ENTRY_NOTE)
All readings done in onActivityResult(int requestCode, int resultCode, Intent data)
Is there any limitation that I am not able to carry data with Intent created via MediaStore.ACTION_IMAGE_CAPTURE
?
Thank you
When onActivityResult is called, "data" is likely a new intent created by the activity that you called. Since you called the camera to start, it does not know about your LIFE_ENTRY values and most likely ignores them. As opposed to your NoteActivity class which you know how to handle those values and can save them/pass them back to the calling activity.
精彩评论