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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:57:34+00:00 2026-05-30T22:57:34+00:00

I have prepared one application.My application will be supports both landscape and portrait. When

  • 0

I have prepared one application.My application will be supports both landscape and portrait.
When i change the orientation from portrait to landscape it is working fine,But when i change landscape to portrait it is not working.my code is,

  public void onConfigurationChanged(Configuration newConfig) {

        super.onConfigurationChanged(newConfig);
        System.out.println("orientation---"+getResources().getConfiguration().orientation);
        if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
            setContentView(R.layout.main);
            System.out.println("landscape-----");
        } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
            setContentView(R.layout.main);
            System.out.println("portrait-----");
        }

    }

Every time time it taking only landscape mode.I made mistake some where. please help.

System.out.println("orientation---"+getResources().getConfiguration().orientation);

The above SOP is printing 2 means landscape.Please help me.(i am using 2.3.3)

  • 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-30T22:57:35+00:00Added an answer on May 30, 2026 at 10:57 pm

    You might be hitting this bug “Orientation does not change from landscape to portrait on Emulator on 2.3”

    More than 45 people are facing the same issue with the androidd 2.3 emulator

    http://code.google.com/p/android/issues/detail?id=13189

    Host OS: Windows 7 SDK tools version : revision 8 Eclipse version: 3.5
    ADT plug-in version: 8.0.1 Platform targeted by your project: 2.3
    Version of the platform running in the emulator:2.3

    STEPS TO REPRODUCE:
    1. Activity 1 (no screen orientation) – Activity 2 (screen orientation = landscape)

    1. Going from Activity 1 to 2 works fine. Pressing back changes the orientation of Activity 1 to landscape

    EXPECTED RESULTS: Activity 1 should be in portrait mode

    OBSERVED RESULTS: Behavior is observed only in gingerbread, works as
    expected on froyo.

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

Sidebar

Related Questions

i have prepared paint application,my application contains one custom view for paint.when we draw
I have some expierence in PHP, but have no one in application architecture Now
I have my application designed with Repository pattern implemented and my code prepared for
I have created one application, where I am storing the data into database and
I have identified a problem within my application; basically, one sub-routine prepares (lots) of
i'm Creating an application that will be working off a User table, the user
I have a web application using PHP and PDO with SQLSRV prepared statements to
i have an application in which i have 2 pages.one page is Register page
I have a c# application (2008) that gets data from sql server (2005). I
I have an Android app that I have just prepared for localization, with one

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.