Saving bundle (activity A):
@Override
protected void onSaveInstanceState(Bundle outState) {
outState.putString(\"test\", \"value\");
super.onSaveInst
Unless your app is running on Lollipop (API21) version of Android or newer, your
public void onSaveInstanceState (Bundle outState, PersistableBundle outPersistentState);
will NOT be called as it simply does not exist on earlier versions of the platform than 21. To support pre API 21 devices you must, instead of the above, override the following method:
public void onSaveInstanceState (Bundle outState);
This will work on API 21+ as well, so you do not need to override both methods, of course (unless you know you need to deal with PersistableBundle the new one offers).
(Copied because it worked for me) Source: onSaveInstanceState is not getting called after screen rotation