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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:55:37+00:00 2026-06-03T09:55:37+00:00

I have a canvas, and it is redrawn when orientation is changed. It’s a

  • 0

I have a canvas, and it is redrawn when orientation is changed. It’s a custom canvas not android provided.

When screen layout is changed, application state and (all of it’s view’s states) gets reset. I changed screen orientation to portrait only; it keeps screen layout unchanged but application is again resetted.

I checked documentation and found that activity is destroyed and restarted again when orientation change occurs. Savestate() cannot save and load bitmap data or any large data which are required by my custom canvas.

I again checked documentation, and found Handling run time changes topic, which mentioned onConfigurationChanged() which gets called when specific configuration change is occurred, which in my case is ‘orientation’. This method prevents restart and leaves to developer how that configuration change should be implemented. It even mentioned in last paragraph that if I will not implement that method then this will just cause the activity to skip onRestart() and will do nothing. I am setting manifest file as

android:screenOrientation="portrait"
android:configChanges="orientation"

And I am not implementing onConfigurationChanged(). But this doesn’t help either. I don’t know why. It seemed so helpful to me.

Please post solution if you have any.
Also, app takes some resonable time, and I would like app do not restart when orientation is changed. Actually I don’t want to do anything when this happens.
I am using emulator too, so please clarify if it is emulator only problem.

P.S. My internet connection is down and I am using my stupid mobile client.
I have checked the offline documentation. And please bear with me for spellings. I am trying to find solution, but currently I am stumpped.

  • 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-03T09:55:39+00:00Added an answer on June 3, 2026 at 9:55 am

    Use this in you AndroidMenifest.xml

    <activity
                android:name="MyActivity"
                android:configChanges="orientation|keyboard|keyboardHidden"
                android:screenOrientation="sensor" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which uses the canvas to draw the scribbling done by
I have a custom view that fills my entire screen. (A piano keyboard) When
I have a canvas object and I am sprinkling fantastic controls all over it.
I have created a custom class derived from Canvas, which contain elements which will
In my Silverlight application I have Canvas control in ScrollViewer and lot of controls
I have a large OpenGL canvas in a Visual C++ MFC application. An edit
I have two Canvas A and B, A is the child of B. A
I have a Canvas with a scale translation applied in XAML. Using DrawingContext I
I have a canvas which contains a single myComponentA. A myComponentA contains a MyComponentB.
I have a Canvas which has many components inside it and those again, 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.