I have two activities and I use android:configChanges=\"keyboardHidden|orientation|screenSize\"
@Override
public void onConfigurationChan
You can save any Object by Overriding public Object onRetainNonConfigurationInstance ()
and calling getLastNonConfigurationInstance() in your onCreate method.
@Override
public Object onRetainNonConfigurationInstance() {
return data;
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
data = getLastNonConfigurationInstance();
}
but if you do this, you have to change your manifest and code, so the normal process for a configuartion change is used.
Different from the SavedInstance method, this only saves the object if the activity is killed because of a configuaration change