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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:47:15+00:00 2026-06-04T16:47:15+00:00

I am working on a tablet application with two fragments on the main activity.

  • 0

I am working on a tablet application with two fragments on the main activity. The left fragment is a list fragment whose contents is updated when the user selects a tab or selects an item from 2 spinners within the ActionBar.

Originally I handled orientation change by overriding onConfigurationChanged. As this is not advised by Google and it causes issues with ActionBarSherlock, I have started work on doing it the right way. I have set my fragments to retain their instance (setRetainInstance) for orientation changes.

The problem is when the orientation changes the OnCreate method for the activity adds the tabs to the actionbar and selects one causing the list to reload. This also happens with the spinners as on rotation a new item is selected. On orientation change the list fragment has no need to refresh.

I know it is possible to save the tab and spinner state but how do I stop the list from updating as this is done in the onTabSelected and onItemSelected methods?

  • 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-06-04T16:47:17+00:00Added an answer on June 4, 2026 at 4:47 pm

    How about using onRetainNonConfigurationInstance() to save some state which should not change on orientation change? For example, if you follow @ThomasKJDK’s answer , you could set the boolean in this method. You could then retrieve this boolean in onCreate(); and decide on execution of various code segments based on this boolean.

    More details about this approach here.

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

Sidebar

Related Questions

I am currently working on an Android tablet application which has two fragments, a
I am working with AlertDialog for user login to an application.I have displayed two
I'm working on a mobile application (C#/WPF on a tablet PC) that prints to
In our application, we have two sets of tables: One set of working tables
I am working on a small reporting application. I have two tables Agent Table
I'm working on a employee booking application. I've got two different entities Projects and
I am working on an mvc application. Two tables each have their individual submit
I am Working on simple login application in which user is first shown login
I have three tables that I am working with User, Application, ApplicationAdministrator. ApplicationAdministrator is
I have application working with SQLite DB(table with two rows) I need to recieve

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.