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 137805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:09:51+00:00 2026-05-11T07:09:51+00:00

I have a question regarding launching new activities. It boils down to this. I

  • 0

I have a question regarding launching new activities. It boils down to this. I have 3 tabs on a view

A) contains gMap activity  B) camera activity  C) some random text fields. 

Requirement is that the application runs in Portrait mode.

All 3 tabs work as expected w/ the exception of the Camera Preview Surface (B). It is rotated 90 degrees. They only way to make it correct is to set the app to landscape which throws all my tabs around, and is pretty much unworkable.

My solution is this : replace

my camera activity with a regular activity that is empty w/ the exception of

Intent i = new Intent(this,CameraActivity.class);     startActivity(i); 

This launches my CameraActivity. And that works fine. I had to do a linear layout and include 3 images that look like real tabs, so I can try and mimic the operation of the tabs while rotating the screen to landscape and keep the visuals as portrait. The user can click one of the images(buttons) to display the next tab. This is my issue. It should exit my ‘camera activity’ returning to the ‘blank activity’ in a tab, where it should be interpreted to click the desiered tab from my image.

The main thing is, when it returns, it returns to a blank (black) page under a tab (because it is ’empty’). How can I capture the return event back to the page that called the activity, and then see what action they performed?

I can set an onclicklistener where I can respond to the fake tabs (images) being clicked to exit out of the camera activity. On exit, the tab should update so that is where you return. any Suggestions?

Thanks,

  • 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. 2026-05-11T07:09:51+00:00Added an answer on May 11, 2026 at 7:09 am

    I’ll focus on answering how to resolve your workround so that it behaves as you want.

    To capture actions performed on one Activity within another requires three steps.

    Launch the secondary Activity (your ‘camera Activity’) as a subactivity by using startActivityForResult instead of startActivity.

    Intent i = new Intent(this,CameraActivity.class);     startActivityForResult(i, STATIC_INTEGER_VALUE); 

    Within the subactivity (camera Activity), rather than just closing the Activity when a user clicks the different tab image, you need to create a new Intent and include the index of the tab to display when you return to the parent app using the extras bundle. To pass it back to the parent call setResult before calling finish to close the camera Activity.

    resultIntent = new Intent(null); resultIntent.putExtra(PUBLIC_STATIC_STRING_IDENTIFIER, tabIndexValue); setResult(Activity.RESULT_OK, resultIntent); finish(); 

    The final step is in the calling Activity, override onActivityResult to listen for callbacks from the camera Activity. Get the extra from the returned Intent to determine the index of the tab you should be displaying.

    @Override  public void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);    switch(requestCode) {      case (STATIC_INTEGER_VALUE) : {        if (resultCode == Activity.RESULT_OK) {        int tabIndex = data.getIntExtra(PUBLIC_STATIC_STRING_IDENTIFIER);       // TODO Switch tabs using the index.       }        break;      }    }  }  
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding .ajaxComplete(). Lets say I do this: // Register an
I have a question regarding inheritance with function objects. I guess this must have
I have question regarding polymorphism about its assignment statement, for Example this is The
I have a question regarding inheritance in Java. If I have this base class
I have a question regarding launching an external application from an asp.net website. Now
I have question regarding the service and activity. I have one service which calls
I have a question regarding this code. I'm a beginner and enjoy learning C#.
I have a question regarding vectors: If I have a std::vector<MyClass> will this vector
I have a question regarding the following method calls: var ctl1 = this.FindControlRecursively(SomeField) as
I have question regarding RESTful resources similar to this other question . We're also

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.