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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:17:09+00:00 2026-05-26T23:17:09+00:00

I wanted to fix screen orientation as a landscape mode in tab i.e on

  • 0

I wanted to fix screen orientation as a landscape mode in tab i.e on 7″
I am calculating the inch of the device in my coding and is setting it as:

int inch=((int)height_pixel1/(int)xdpi);
if(inch>=6){
    orientation=true;
    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
    orientation=false;
    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

and the problem is firstly it displays me the screen orientation as according to my requirement,but when processing is going on in between , then it changes the orientation as portrait way and again in landscape way.. It is still toggle between these two orientation and I want to make a fixed orienattion for my whole application…Is there any property that I am missing here??

  • 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-26T23:17:09+00:00Added an answer on May 26, 2026 at 11:17 pm

    Create a folder layout-xlarge-land and put your XML in it… it should be designed for landsacpe screen.. also You have to give

    android:largeScreens="true"  in manifest... 
    
    
    res/layout/my_layout.xml             // layout for normal screen size ("default")
    res/layout-small/my_layout.xml       // layout for small screen size
    res/layout-large/my_layout.xml       // layout for large screen size
    res/layout-xlarge/my_layout.xml      // layout for extra large screen size
    res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation
    
    
    
    
    
     <supports-screens android:resizeable=["true"| "false"]
                          android:smallScreens=["true" | "false"]
                          android:normalScreens=["true" | "false"]
                          android:largeScreens=["true" | "false"]
                          android:xlargeScreens=["true" | "false"]
                          android:anyDensity=["true" | "false"]
                          android:requiresSmallestWidthDp="integer"
                          android:compatibleWidthLimitDp="integer"
                          android:largestWidthLimitDp="integer"/>
    

    Refer
    http://developer.android.com/guide/topics/resources/providing-resources.html

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

Sidebar

Related Questions

I wanted to generate one fix view using interface builder, but the size of
Just wanted to know if this function's results will always hold? private int calcHourDiff(int
So I wanted to test my app on an actual android device. I've debugged
I've changed text in the app_name string (just wanted to fix the spelling). When
I wanted to sort my asp grid by setting AllowSorting="True". I also added codes
I wanted to compare the current system date to a fix date, but get
Wanted to convert <br/> <br/> <br/> <br/> <br/> into <br/>
Wanted to get some consensus around a UI feature I'm working on right now.
Wanted to know if someone had a suggestion on code or maybe there's a
I wanted some of those spiffy rounded corners for a web project that I'm

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.