I've recently started learning Android (after completing Java EE), and come across a reference variable (savedInstanceState
) of a class named Bundle
, passed as an argument in the method called onCreate
. I've been pondering upon it for quite a while and cannot find any relevant answer! Help?
Asked
Active
Viewed 52 times
0

Mad Physicist
- 107,652
- 25
- 181
- 264

Ripudaman
- 21
- 6
-
Welcome to Stack Overflow! You can take the [tour] first and learn [ask] a good question and create a [mcve]. That makes it easier for us to help you. – Katie Mar 15 '17 at 15:04
-
What's the question? – Mad Physicist Mar 15 '17 at 19:22
-
It's the bundle that you modify in `savedInstanceState()` on orientation changes. http://stackoverflow.com/questions/151777/saving-android-activity-state-using-save-instance-state – DeeV Mar 15 '17 at 19:32
-
This can help you: https://content.pivotal.io/blog/android-savedinstancestate-bundle-faq – muazhud Mar 15 '17 at 19:53
-
@muazhud Thank you! it was helpful :) – Ripudaman Mar 16 '17 at 14:58
1 Answers
0
onCreate
method is responsible to launch the activity and bundle class is a kind of data structure which stores the data used previously if some disturbance occurs in during using that activity (like you rotated the phone if someone called you ) with the help of reference variable savedinstancestate
and you can now access the previous data that means you will start from there where picked up the phone.

Pankaj
- 2,220
- 1
- 19
- 31