
But the reason it is used in app is because that method is the best place to put initialization code.
Basically Bundle class is used to stored the data of activity whenever above condition occur in app. After Orientation changed then onCreate(Bundle savedInstanceState) will call and recreate the activity and load all data from savedInstanceState. object of Bundle Class will save the state of an Activity.
from horizontal to vertical or vertical to horizontal) of activity gets changed or when an Activity gets forcefully terminated by any Operating System then savedInstanceState i.e.
When an Activity first call or launched then onCreate(Bundle savedInstanceState) method is responsible to create the activity. OnCreate(Bundle savedInstanceState) Function in Android:
2 Example of onCreate(Bundle savedInstanceState):.1 onCreate(Bundle savedInstanceState) Function in Android:.