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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:25:07+00:00 2026-06-03T02:25:07+00:00

I use these functions in an activity class: onSaveInstanceState onRestoreInstanceState onPause onCreate When the

  • 0

I use these functions in an activity class:
onSaveInstanceState
onRestoreInstanceState
onPause
onCreate

When the user starts the Activity onCreate gets called, when the user ends, onPause gets called. Thats fine so far.

But when the user rotates the phone,
onPause
onSaveInstanceState
onCreate
gets called. I would have expected onRestoreInstanceState before onCreate. Why is this so and how should I handle initialization of ui-data if not there?

  • 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-03T02:25:08+00:00Added an answer on June 3, 2026 at 2:25 am

    I would have expected onRestoreInstanceState before onCreate.

    The documentation for onRestoreInstanceState() clearly states:

    This method is called after onStart() when the activity is being re-initialized from a previously saved state, given here in savedInstanceState. Most implementations will simply use onCreate(Bundle) to restore their state, but it is sometimes convenient to do it here after all of the initialization has been done or to allow subclasses to decide whether to use your default implementation.

    If you wish to initialize your UI with stuff from the Bundle in onCreate(), feel free to do so.

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

Sidebar

Related Questions

I use these two files here and here . I created a class in
I want to use min(5,10) , or Math.max(4,7) . Are there functions to this
I was wondering if there was anyway to use functions like ReadFileEx that require
I am trying to use the peek function in Visual Studio 2010 with these
I want to use these two classes from lucene - import org.apache.lucene.analysis.snowball.*; import org.apache.lucene.analysis.PorterStemmer;
I use OrmLite and I want to get the helper class (and then get
I'm writing an activity in Android where the user modifies an SQL Database. The
To lock my orientation to portrait, I use: activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); I'm unsure what flag tells
The function below gets two values from sharedpreferences, weight and height, and I use
I have 3 classes A, B, and C. These extend another class D. Class

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.