Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5963959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:20:47+00:00 2026-05-22T19:20:47+00:00

in my app i have two activities namely A and B. From activity A

  • 0

in my app i have two activities namely A and B. 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:20:48+00:00Added an answer on May 22, 2026 at 7:20 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app with two activities: 1st - listview with links to html
I have two activities in my app. One is a list that is presented
I am experiencing strange log cat behaviour in my app, either I have two
I have an Android App with a number of activities. The wrong activity is
I have two activities: one displays an image and a button, the other displays
I have two different Search activities implemented with SearchManager in my app. One is
I have a problem with my app. It has a lot of activities. Two
in my app i am just running between two activities namely A and B.
In my app I have two activities. At the time of launch I am
I have a three-page/Activity setup/configuration piece to my app. I want to have two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.