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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:45:50+00:00 2026-05-26T07:45:50+00:00

I am trying out using fragments with my tabhost for the first time and

  • 0

I am trying out using fragments with my tabhost for the first time and I am pretty impressed. That said, one of my tabs uses two fragments, first the user sees Fragment A and then if they hit a button in Fragment A it gets swapped with fragment B, and puts fragment A on the backstack. This all seems to work fine, except it does something funny on a change in orientation:

If the user is on Fragment B and there is an orientation change, it still shows fragment B. However if after the orientation change, they switch to a different tab and then switch back to the original tab, it goes back to showing Fragment A.

This does not happen without the orientation change. IE… if you are just on Fragment B, switch tabs, and then switch back, you still see Fragment B. Is there any way to preserve this across an orientation change?

Thanks in advance!

  • 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-26T07:45:51+00:00Added an answer on May 26, 2026 at 7:45 am

    try to add this code to your manifest, for your activity:

    android:configChanges="orientation|keyboardHidden"
    

    ______EDIT______

    As ErstwhileIII mentioned, this is not real fix, and this will force Android to don’t recreate Activity when device rotated. However, as you can see, I have answered to this question on October 14, 2011, and if you are looking for better answer, just try to find newer answers.

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

Sidebar

Related Questions

I'm trying to find SQL statements that timed out using the SQL 2005 profiler.
I'm trying to figure out how to implement my first RESTful interface using Django
I'm using the multicol package inside an a0poster document class. I am trying out
I'm trying to find out whether I should be using business critical logic in
I was trying to check out a project from SVN using Eclipse. I tried
rather than using a textnode to show content im trying to figure out how
I'm trying to find out how to programmatically (I'm using C#) determine the name
I'm trying to figure out if there is a way (using JavaScript, or jQuery
I am using the Ribbit javascript api and trying to figure out how not
I'm trying to figure out how to replace binary data using Java. below is

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.