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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:49:08+00:00 2026-05-26T18:49:08+00:00

i have question about two different Bundle object in below methods : onSaveInstanceState(Bundle outState);

  • 0

i have question about two different Bundle object in below methods :

onSaveInstanceState(Bundle outState);
onCreate (Bundle savedInstanceState);

how android system know that bundle object in onCreate method is object that programmer used for save his/her activity states and onCreate method use that Bundle object to get activity state that is killed by system?
is the Bundle object one of the Activity class Members and super.saveInstanceState(outState);
save the Bundle in the Bundle object of Activity and when an activity call onCreate(Bundle ) method this member send to onCreate method?how can i use Bundle in onCreate( ) method?
please help me…

  • 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-26T18:49:08+00:00Added an answer on May 26, 2026 at 6:49 pm

    The values you save in the onSaveInstanceState method’s bundle will be sent back to you in onCreate. As an example of how this works.

    1. You get a phone call.
    2. Your Activity is stopped and onSaveInstanceState is called. You put a value into this bundle.
    3. Android finishes your activity and destroys that instance because the OS needs memory.
    4. The user returns to your application.
    5. The bundle is recreated from some type of persistent storage that Android maintains on your behalf. Now your onCreate can grab the value you placed in the bundle during onSaveInstanceState

    EXAMPLE

       @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.lldr_activity);
    
        mFilterCheckbox =  (CheckBox) findViewById(R.id.checkbox_id);
        if(savedInstanceState != null) {
            mFilterCheckbox.setChecked(savedInstanceState.getBoolean("FILTER_STATE", false));
        }
    }
    
     @Override
        protected void onSaveInstanceState(Bundle outState)
        {
            super.onSaveInstanceState(outState);
            outState.putParcelable("FILTER_STATE", mFilterCheckbox.isChecked());
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question about OO design. Suppose I have a base object vehicle. And two descendants:
I have a question about the merits of two different approaches to implementing a
I have two examples I have a question about. Let me explain via some
I have a question about how to set up the relations between two models
I have a question about the singleton pattern. I saw two cases concerning the
I have a generic question about scope and encapsulation. Take two scenarios: Scenario 1:
Question I have two compilers on my hardware C++ and C89 I'm thinking about
I have a question about Haskell polymorphism. As I've learned, there are two types
Where to start? Question is about two different ways to achieve the same thing,
I have question about global variable in Objective-C. I have two .m files :

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.