What is Bundle? What does it contain in onCreate() of your activity?
Bundle will be null always in onCreate()
Bundle contain previous savedInstantceState
Bundle contain previous restoredInstanceState
Bundle contains information passed from other activities when it was started using startActivity()
Bundle is a data holder, which holds data to be passed between activities.
In case of forceful closing of an activity, android will save all its UI states and transient states so that they can be used to restore the activity's states later. This saved states will be passed via Bundle in onCreate() function to restore its states once android recreates a killed activity.
EG: this will happen in case of low memory or configuration changes like rotating the phone.
This function will be called by aAndroidAndroidndroid before “ompause” or after “onpause” if aAndroidAndroidndroid is forcefully killing your activity. In this function we have to save all your activity states.
This function will be called after “onStart”.
Back To Top