How to move back to a particular activity after Image capturing in android?

Use this for Taking Photo and store it in Sdcard : public void takePhoto() { Intent intent = new Intent("android.media.action. IMAGE_CAPTURE"); File folder = new File(Environment. GetExternalStorageDirectory() + "/Photo"); boolean success = false; if(!folder.exists()){ success = folder.mkdir(); } final Calendar c = Calendar.getInstance(); String path=String.

Format("/sdcard/Photo/%s. Png","Photos"); photo = new File(path); intent. PutExtra(MediaStore.

EXTRA_OUTPUT,Uri. FromFile(photo)); imageUri = Uri. FromFile(photo); startActivityForResult(intent, TAKE_PICTURE); } Use onActivityResult Method : Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.

OnActivityResult(requestCode, resultCode, data); switch (requestCode) { case TAKE_PICTURE: if (resultCode == Activity. RESULT_OK) { // Use your server Post Coding : // Get the Rsponse as String and compare here if(response. EqualsignoreCase("POST SUCCESS")){ startActivity(new Activity (CurrentActivity.

This,Activity2. Class)) } super. OnActivityResult(requestCode, resultCode, data); } } After the Image captured from Camera its will come to onActivityResult() method Check the Response and Redirect the Page Accordingly.

Use this for Taking Photo and store it in Sdcard : public void takePhoto() { Intent intent = new Intent("android.media.action. IMAGE_CAPTURE"); File folder = new File(Environment. GetExternalStorageDirectory() + "/Photo"); boolean success = false; if(!folder.exists()){ success = folder.mkdir(); } final Calendar c = Calendar.getInstance(); String path=String.

Format("/sdcard/Photo/%s. Png","Photos"); photo = new File(path); intent. PutExtra(MediaStore.

EXTRA_OUTPUT,Uri. FromFile(photo)); imageUri = Uri. FromFile(photo); startActivityForResult(intent, TAKE_PICTURE); } Use onActivityResult Method : @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.

OnActivityResult(requestCode, resultCode, data); switch (requestCode) { case TAKE_PICTURE: if (resultCode == Activity. RESULT_OK) { // Use your server Post Coding : // Get the Rsponse as String and compare here if(response. EqualsignoreCase("POST SUCCESS")){ startActivity(new Activity (CurrentActivity.

This,Activity2. Class)) } super. OnActivityResult(requestCode, resultCode, data); } } After the Image captured from Camera its will come to onActivityResult() method Check the Response and Redirect the Page Accordingly.

Call finish(); when you're done with Activity B and it will reliably close and return to Activity A.

From activity A I am moving to activity B by clicking a button. In activity B I have a button and when the use clicks it opens either the library or camera according to the user's wish. Here either the user selects an image or captures an image, the image is been uploaded to server.

After this activity gets overed I want to show the Activity A automatically. If the user clicks the default back button, I have written code to move to Activity A, butin some times it gets closed automatically after the uploading process, in such case I want to show only Activity A and not B.

Use this for Taking Photo and store it in Sdcard.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions