I'm trying to make a app that will allow the user to take a photo then display it in the app and save it.
I'm using the following code to take the picture (from Google)
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(takePictureIntent, 1);
How can I tell when the user presses the back button and return to my app so I can display the image???
You did startActivityForResult in the same activity
you need to call
onActivityResult(int requestcode, int resultCode, Intent data){
if(resultCode==RESULT_OK){
if(requestCode==1){
// get your data from the intent
}
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments