Can someone please explain why the value in my savedInstanceState is null? I have 3 widgets, an EditText, Button and TextView. The person types in what they want. The Phrase
You need to use this function onSaveInstanceState(Bundle outState)
, the one without PersistableBundle outPersistentState
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState, outPersistentState);
outState.putString("example",newString);
}
void onSaveInstanceState (Bundle outState,
PersistableBundle outPersistentState) this will only get called when you have attribute persistableMode
specified in the activity tag inside manifest
You can read more about it here