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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:45:25+00:00 2026-06-06T12:45:25+00:00

I have created two folders layout and layout-land with two xml files, one for

  • 0

I have created two folders layout and layout-land with two xml files, one for portrait and the other for landscape. Both of the xmls work but here is the problem.

My first screen is a login screen and my second screen is a main screen. If I login in portrait and then turn my phone landscape at the main screen. The layout will landscape turn but it uses the portrait xml for the main screen.

The same error occurs if I start in landscape and try to move to portrait later on.

It seems like whatever layout I do for my main then that’s the layout that will be used for the rest of the app. Is there anyway to go around this?

Also. I’m already using android:configChanges=”orientation” in my manifest for the activities.

  • 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-06T12:45:27+00:00Added an answer on June 6, 2026 at 12:45 pm

    If you are using android:configChanges="orientation", then you can override onConfigurationChanged to inflate the new layout after a configuration change.

    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);                
        setContentView(...);
    }
    

    Make sure you have a good reason for preventing the Activity from being recreated on an orientation change… and most importantly don’t just do it because orientation changes are crashing your app. Handling the configuration change yourself can make it much more difficult to use alternative resources, because the system does not automatically apply them for you. This technique should be considered a last resort when you must avoid restarts due to a configuration change and is not recommended for most applications.

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

Sidebar

Related Questions

I have created two JavaScript files. One file is "validators.js" and the other is
making a multi-language site with codeginiter. I have created two folders. One for french
I have created two DbContexts, one is for application configuration, the second is for
I have created two forms in my Windows Application. One Form acts as a
I have created two files: tunables.h #ifndef TUNABLES_H #define TUNABLES_H void tunables_load_conservative(); void tunables_load_aggressive();
I have created two viewController classes such that one is superclass of another.i have
My application currently installs documents and other files to two folders using lines like:
I have created two packages in eclipse. The actitivites in both the packages use
I guess I have two questions actually: One: How do I create folders with
I have created two imageViews promatically as shown below: public void createImageViews(Integer count){ ImageView[]

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.