1
I have two activities that I will call activityA and acitivityB.
In my activityA I have the following method.
@Override
protected void onSaveInstanceState(Bundle bundle) {
bundle.putString("ACTIVITY", "Dados que precisando ser salvos!");
super.onSaveInstanceState(bundle);
}
When I go to Activityb this above method is called. But when I go back to Activitya in the onCreate() method; my Bundle is null.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null){
String teste = savedInstanceState.getString("ACTIVITY");
}
}
Can anyone tell me why?