OnDestroy is called whenever the screen turns off

I am aware that this problem has been previously reported and I have used all the recommended solutions, but nothing has worked so far.

As mentioned in the title, this onDestroy()

is called every time the screen turns off. This does not happen if the service is enabled.

The app has a fixed orientation and therefore

android:screenOrientation="portrait"

      

As per some earlier suggestions, I added

android:configChanges="orientation|keyboardHidden"

      

etc .. I also implemented onConfigurationChanged()

but it never gets called.

Two important points:

  • We only run into the problem on one device in our test setup, Samsung Duo running 4.0.4. On all other devices this is not a problem.
  • This issue does not happen with other applications running on the same device.

Thank your help.

thank

Update . It seems that setting this flag is causing the problem. Removing them solves them, but they were used for a reason, so any other insight would be appreciated.

Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY

      

+3


source to share





All Articles