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

  • Home
  • SEARCH
  • 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 6973897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:10:03+00:00 2026-05-27T17:10:03+00:00

I am working on an app where all activities are set to: android:screenOrientation=portrait Here

  • 0

I am working on an app where all activities are set to:

   android:screenOrientation="portrait" 

Here is what happens:

Tablet is in portrait mode BEFORE the app starts:

  • startScreen is created in portrait mode
  • one navigates to another portrait screen
  • one goes back to startScreen – it gets created in portrait mode – everything OK

And this is what happens when the tablet is in landscape mode when
the app starts:

  • startScreen is created in portrait mode
  • one navigates to another portrait screen
  • one goes back to startScreen – it gets created in LANDSCAPE mode only to be immediately closed within a fraction of a second and the activity gets distroyed – then finally the activity gets created in porttrait mode

How can I avoid this creation in LANDSCAPE mode for a fraction of a second and immediately be created in portrait mode only?

Many 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-27T17:10:03+00:00Added an answer on May 27, 2026 at 5:10 pm

    Add in your manifest in the activity tag: android:configChanges=”orientation”. Now it will not restart in the orientation.

    This is a theory only, but if you see your screen in landscape mode first you you can perhaps override your root view and override the onDraw method.
    Check your canvas width and height.
    If the height is bigger smaller than width don’t draw or set visibility false.
    Until you receive the “right” canvas to draw upon.

    It might be an overkill but I think it might be done.

    Also look for more possible things that can change screen orientation here:
    http://developer.android.com/guide/topics/manifest/activity-element.html#screen

    There is another one from API 14 and up (I think) that caused me a lot of problem which is “ScreenSize”.

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

Sidebar

Related Questions

Okay, here's my setup. I have a c# app working perfectly on all 32-bit
I am working on an android app that has two activities. One is the
java.lang.IllegalStateException: System services not available to Activities before onCreate() at android.app.Activity.getSystemService(Activity.java:3536) at android.accounts.AccountManager.get(AccountManager.java:261) at
I'm working on a GAE app. I want to query datastore and retrieve all
I'm working on a visualisation app with Processing. All appears to be going well,
I am working on an iPhone app, in which I have to enlist all
All, I'm working on an HTML-based web app (i.e., not native app) targeted for
Im working on an app designed for android 3.0 onwards, and I want to
I'm working on my app that is based on a navigationController, all programatically, no
My app is all done and working great. So now I ran it on

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.