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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:07:54+00:00 2026-05-19T11:07:54+00:00

I am trying to make it so my app never goes into portrait mode

  • 0

I am trying to make it so my app never goes into portrait mode but is able to switch between the 2 landscape screen views. I know this can be done easily in Gingerbread (2.3) but I am having trouble doing it manually for the other versions of android, my code is as follows:

Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
        int orientation = display.getRotation();
        if (orientation == 1) {
            /* The device is rotated to the left. */
            Log.v("Left", "Rotated Left");
        } else if (orientation == 3) {
            /* The device is rotated to the right. */
        Log.v("Right", "Rotated Right");
        } else { 

        }

My problem is how do I flip the x and y-axis of the screen view depending on the rotation detected? How do I get hold of them in order to reverse them?

  • 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-19T11:07:55+00:00Added an answer on May 19, 2026 at 11:07 am

    As far as I know there is no support for inverted layout before 2.3.
    So unless you are drawing the screen with a custom SurfaceView I’d say you cannot do it using standard widgets.
    With a surface view, you would simply need to transform the whole canvas before rendering to it.

    Additionally, you should use constants in order to know the current orientation (no magic numbers), see the Configuration class API documentation

    if (orientation==Configuration.ORIENTATION_LANDSCAPE) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make App Distribution from Facebook for android apps. But the
I am trying to make an app that will pass data between two servers
I'm trying to make a POST request to my Sinatra app, but I'm having
I'm trying to make my app a good Windows citizen, so I use matching
I'm trying to make my app publish to all my friend's walls. From what
I am trying to make an app in which i use the Grouped Table
I'm trying to make an app I'm designing more generic and implement the command
I was wondering : I'm trying to make an app that as a Listview,
I have an app with tabbar and webview. I'm trying to make the app
I am trying to make a web app in Dashcode that uses a range

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.