0

I created a new project and entered the following code:

 @Override
protected void onSaveInstanceState(Bundle outState) {
    // TODO Auto-generated method stub
    super.onSaveInstanceState(outState);

    System.out.println("onSaveInstanceState " );


}

press cntrl F11 and cntrl F12 to rotate my emulator... and this method never got called.

am i missing something ?

user3430459
  • 271
  • 3
  • 7
  • possible duplicate of [Android: onSaveInstanceState not being called from activity](http://stackoverflow.com/questions/12793069/android-onsaveinstancestate-not-being-called-from-activity) – JRomero Mar 25 '14 at 17:28
  • this is not the same issue as in that article – user3430459 Mar 25 '14 at 17:35

1 Answers1

0

The code above is fine. The system calls this method when the user is leaving your activity, so it should be called when changing the orientation. Verify your LogCat for the output. This example can be helpful.

Recreating an Activity

amunozdv
  • 111
  • 3