0

I am using AndEngine in application which is in landscape orientation. After executing my app I am turning off the device and again turning it on. After rotate the device to portrait mode I am unlocking the screen. Then my application is finished.

I have next sequence execute methods before recreate activity

02-06 16:13:57.317: W/OnCreate(2722): Tadammmmmmmmmm!!!
02-06 16:13:57.356: W/onLoadEngine(2722): Tadammmmmmmmmm!!!
02-06 16:13:58.270: W/onStart(2722): Tadammmmmmmmmm!!!
02-06 16:13:58.457: W/onResume(2722): Tadammmmmmmmmm!!!
02-06 16:13:58.942: W/onWindowFocusChanged(2722): Tadammmmmmmmmm!!!
02-06 16:13:58.942: W/onLoadScene(2722): Tadammmmmmmmmm!!!
02-06 16:13:59.122: W/onLoadComplete(2722): Tadammmmmmmmmm!!!
02-06 16:13:59.129: W/onResumeGame(2722): Tadammmmmmmmmm!!!
02-06 16:14:31.965: W/onPause(2722): Tadammmmmmmmmm!!!
02-06 16:14:32.137: W/onStop(2722): Tadammmmmmmmmm!!!
02-06 16:14:32.598: W/onWindowFocusChanged(2722): Tadammmmmmmmmm!!!
02-06 16:14:43.536: W/onDestroy(2722): Tadammmmmmmmmm!!!

Then I am have next sequence after rotate device, but before unlock screen

02-06 17:44:05.661: W/OnCreate(8784): Tadammmmmmmmmm!!!
02-06 17:44:05.684: W/onLoadEngine(8784): Tadammmmmmmmmm!!!
02-06 17:44:06.067: W/onStart(8784): Tadammmmmmmmmm!!!
02-06 17:44:06.122: W/onResume(8784): Tadammmmmmmmmm!!!
02-06 17:44:06.145: W/onPause(8784): Tadammmmmmmmmm!!!
02-06 17:44:07.942: W/onStop(8784): Tadammmmmmmmmm!!!

Then I am have next sequence after unlock screen

02-06 17:44:12.387: W/onStart(8784): Tadammmmmmmmmm!!!
02-06 17:44:12.450: W/onResume(8784): Tadammmmmmmmmm!!!
02-06 17:44:12.543: W/onPause(8784): Tadammmmmmmmmm!!!
02-06 17:44:12.551: W/onStop(8784): Tadammmmmmmmmm!!!
02-06 17:44:12.590: W/onDestroy(8784): Tadammmmmmmmmm!!!

I do not understand what need for full recreate activity, and do not change orientation from landscape to portrait. Question is - why activity is not recreate full and finished.

I'm find answer - add in manifest android:configChanges="...|screenSize" for do not recreate my activity.

  • 1
    What's your question? Why do activities are recreated after an orientation change? It's how Android is designed, many of us don't understand it too, but we can't do anything about that:-) – thelawnmowerman Feb 06 '13 at 15:04

1 Answers1

0

It turns out that just about everything about an application can change, during a rotation. Consider, for instance an application that has different layouts in layout-port and layout-land. Those layouts could have different fonts, different view trees, different everything. Under the circumstances, it is most effective, simply, to completely re-create the Activity.

Look on the bright side! C-F11 is a way to produce a complete coverage test on the lifecycle methods for your application.

G. Blake Meike
  • 6,615
  • 3
  • 24
  • 40