0

I have been using log messages in the activity lifecycle functions to monitor the behaviour of applications's activity, and some time ago i discovered a weird unintended recreation of the activity. This behaviour is specific, because it occurs only, if activity at the moment of screen turning of is LANDSCAPE orientation.

The steps of this behaviour are following:

  1. while in LANDSCAPE orientation, the screen turns off, calling the onPause() and onStop() functions (probably onDestroy(), i am not monitoring it)
  2. after few seconds, while the screen is still off, onCreate() of this activity is called, but with PORTRAIT orientation property
  3. this cycle goes to onResume(), which is immediately followed by onPause() function (onStop() is not called)

If the screen turns off while being in portrait orientation, the activity lifecycle follows the proper path, with no debug messages after onStop is called.

Since the activity class in question is over 1800 lines long, for now i will avoid posting it here.

I am aware, that the description of my problem is generic,but hope, that maybe someone else has experienced similar problem and can maybe point towards the possible source of the problem.

aphelion
  • 561
  • 1
  • 5
  • 12

0 Answers0