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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:44:34+00:00 2026-05-23T02:44:34+00:00

Which method of the lifecycle is called when orientation changes occur? My application executes

  • 0

Which method of the lifecycle is called when orientation changes occur?
My application executes the onResume() method or maybe reloads the whole activity because I’ve set one boolean to check whether it is first run or not. I’ve read onConfigurationChanged() starts when orientation change occur, is it true?
How to handle this?

  • 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-23T02:44:34+00:00Added an answer on May 23, 2026 at 2:44 am

    Interesting one…

    Activity is start onResume() is which you declare in your XML by default.

    And as I found from question answer on stack overflow is:

    Orientation Change

    • onSaveInstanceState
    • onPause
    • onStop
    • onCreate
    • onStart
    • onRestoreInstanceState
    • onResume

    Switch TO Activity 2

    • onSaveInstanceState
    • onPause

    Orientation Change WHILE IN Activity 2

    • onStop
    • onCreate
    • onStart

    Switchback BACK FROM Activity2

    • onResume

    I’m guessing that because Activity 1 is hidden at the time of rotation, onRestoreInstanceState isn’t called because there is no ‘view’ (i.e., it can’t be seen/viewed). Also, it is entirely possible to have 2 completely different layout files for portrait/landscape which potentially have different UI elements with different IDs.

    As a result, I’d say if you want to use the Bundle in onSaveInstanceState to save your own data, then you need to add extra logic in your onCreate (in Activity 1) to process your own data there (as well as doing it conditionally in onRestoreInstanceState).

    In particular, you could maintain a ‘last known’ orientation field so that onCreate knows that it needs to process your own data because orientation has changed, rather than relying on onRestoreInstanceState being called.

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

Sidebar

Related Questions

Is there a method of the Activity lifecycle which is called if the user
Which method View() is called last in the System.Web.Mvc.Controller? Or should I override each
I'm writing an application which sends a lot of emails throughout the app's lifecycle.
Which method is preferred? Session.Remove(foo); Session[foo] = null; Is there a difference?
Which method would you recommend to pass data from a child view back to
Which method makes the most sense for importing a module in python that is
Which method do you think is the best. Use the System.IO.Packaging namespace? Use interop
which method do you prefer for creating dynamic sql queries? formating or streaming? Is
Which method is preferred for adding a row to a table? var tr =
Which method is very effective and simple to code to attain this functionality ?

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.