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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:16:14+00:00 2026-06-10T00:16:14+00:00

Is there a way for the Android Manifest to be different depending on screen

  • 0

Is there a way for the Android Manifest to be different depending on screen size? I want android:configChanges to not include “orientation” if the device is a tablet (ie xlarge screen size)

Moreover, I want android:screenOrientation to be different depending on which device is used. Any advice?

  • 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-10T00:16:15+00:00Added an answer on June 10, 2026 at 12:16 am

    I know of no way to do something that complex in AndroidManifest.xml, however you can do it programmatically via Activity.setRequestedOrientation() method. It’s easy enough to wrap this in a utility class and then query your environment accordingly. One word of warning though – if calling this method does actually result in an orientation change, your Activity’s onCreate() will be called a second time. Another thing that might come in handy if you choose to go this route, if the following evaluates to true:

    if((cfg.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {...}
    

    Then you are on a tablet device, or at least your layouts are being loaded from layout-large (if you have one). Puting it all together, the following would lock a tablet into landscape mode and phones into portrait mode:

          if ((cfg.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {
             return true;
          } else if ((cfg.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL) {
             return false;
          } else if ((cfg.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_SMALL) {
             return false;
          } else {
             // Assume that all other ratings are tablets or possibly even larger devices; there is an
             // extra large spec however it is only available OS versions 3.x and above so there is no clean way to query for this state.
             return true;
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to use a different theme depending on which SDK version
I want to fix screen orientation on my android application to portrait. Using google,
Is there any way we can read/parse android manifest file as we do it
is there a way on android to collect all of the controls within an
Is there a way in Android (starting with API 8) to create a service
Is there a way in android to invoke a numeric only keypad, i.e. a
Is there a way in Android to get the upcoming alarm time? Thanks Clarification:
Is there any way for an Android phone with NFC (Nexus, Galaxy, etc.) to
Is there a way for an Android user to browse the SQLite databases on
I would like to know if there is a way in Android to have

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.