In my program, there is some textfields and a button which is opens a camera intent. (assume that the page’s name is mainIntent)… Lets assume that, user fills textfields and clicked the button; cameraIntent opens, user shots the photo.. Now, I want program to return the page which have textfields and button. But if I do
Intent i = new Intent(cameraIntent.this, mainIntent.class);
startActivity(i);
All the texts which are written by user are gone. I need to use something like return mainIntent I suppose…
Can someone help me?
Use startActivityForResult in first activity. So you will be able to return to calling activity. And you won’t lose data of edit texts.
You can add this for
onActivityResult():In your activity next activity, you will just need to call
setResult()andfinish()as follows. You won’t need to start new activity here:Hope it helps.