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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:41:22+00:00 2026-05-28T03:41:22+00:00

I defined dynamically all GUI components.When the Cntrl+F11 is first pressed the layout updates

  • 0

I defined dynamically all GUI components.When the Cntrl+F11 is first pressed the layout updates correctly to from portrait to landscape. But when I press Cntrl+F11 again, layout remains in its “landscape” look. How can I update it for “portrait” look again? The source code:

//Main Layout ll
LinearLayout ll ;
ll.setOrientation (LinearLayout.VERTICAL);
ll.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

//Inner layout ll2 is inside of the main layout ll
LinearLayout ll2 = new LinearLayout (this);
ll2.setWeight(1.0f);

LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
lp.weight = 0.25f;

//Button b is inside of the inner layout ll2
Button b = new Button (this);
b.setLayoutParams(lp);
ll2.addView (b);

ll.addView(ll2);

I tried this solution (from this site):
I added function

    public void onConfigurationChanged(Configuration newConfig) {
      super.onConfigurationChanged(newConfig);
      setContentView(ll);
    }

and set I in AndroidManifest

android:configChanges="keyboardHidden|orientation"

but it stiil doesn’t work.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. Editorial Team
    Editorial Team
    2026-05-28T03:41:22+00:00Added an answer on May 28, 2026 at 3:41 am

    use this in xml file

    android:orientatoin=”portrait “

    it is also possible to write in onCreate() method also

    You Also specify in ANDROID_MANIFEST like this

     <activity android:name=".activityName" android:screenOrientation="landscape"></activity>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, I use user-defined header and corresponding cpp file. Then I include
In Objective-C, I usually see methods that return a dynamically typed object defined as
I defined a global variable that is called from other view and it is
I'm wanting to detect all objects(classes) defined in a php file (example: flavors.php). The
Is there a way to debug a function that is defined dynamically in run
I'm dynamically generating RDL files for SSRS 2008, assembling my reports from building blocks
I am trying to invoke an internal method from a dynamically generated one. The
If for example I have defined a root linear layout whose orientation is vertical:
I have a flash movie that loads images dynamically from an xml file. I
I'm planning a webapp. I have all the wireframes defined, the interfaces designed in

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.