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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:54:50+00:00 2026-05-27T19:54:50+00:00

I have designed an app for android tablets and it consists of a tab

  • 0

I have designed an app for android tablets and it consists of a tab bar. I have designed two layouts for each tab as one for landscape and the other for portrait. When the user selects any one of the tab, at first i am showing a progress bar in asynchronous task and some data get loaded.

Currently i am working on with the on restore instance, here when the user rotates the app to either landscape from portrait or viceversa, the asynchronous task is been called again and the data get loaded from the first process.

I tried using the OnConfig method, in this method when rotating from portrait to landscape, the portrait layout is shown in the landscape mode whereas i have designed some changes in landscape layout compared to the portrait one. As i have different layouts for landscape and portrait, i am unable to use the OnConfig.

How to overcome the issue, i dint want to use OnConfig method and i tried Onrestore instance state, both are not solving my issues…pls suggest me a better way……

  • 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-27T19:54:51+00:00Added an answer on May 27, 2026 at 7:54 pm

    I do not recommend overriding the onConfigurationChanged method (and not putting orientation as one of your config overrides in the manifest file). With an orientation change, the activity will be recreated, which is great because it will load your new layout with all the correct resource files.

    As for the AsyncTask, a common pattern would be to not couple this with the Activity. Instead, you could perhaps create a singleton mananger class that holds a reference to the activity as a listener. When the Activity respawns, you can update the manager class with the new Activity instance for the callback and when the async process finishes, it will notify the current activity.

    In order to maintain the progress bar, you could keep a state variable that gets saved during onSaveInstanceState and restored with onRestoreInstanceState that could be used for showing/hiding views. Anther option would be to poll the manager class for the running process and update the layout accordingly during onCreate

    This may not be the quickest and simplest solution but a good framework for this will help down the road.

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

Sidebar

Related Questions

I have a doubt in layouts.I have designed one layout using group layout using
I am a beginner to android and have designed a login GUI for app
I have developed application in Android and designed one splash screen image of size
I have designed an app in vb.net 2005 that at one point adds and
I have a wpf app that needs to communicate(exchange data) with a custom designed
I have designed one sign-up form,in this form after getting all necessary values I
I'm writing an app and I want one of my activities to have a
I have designed a multithreaded app, which is starting most windows in an dedicated
I have a website designed for the android browser using jquery/jqtouch. As a part
I have designed a web app, this application contains not only some complex controllers,

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.