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
android screen ondestroy


source to share


No one has answered this question yet

Check out similar questions:

1770
Get screen dimensions in pixels
687
Android error: Failed to install * .apk on device *: timeout
449
How to get screen width and height in iOS?
28
"Unable to execute this action after onSaveInstanceState" - why am I getting this exception from my onResume method?
2
Android: screen rotation, destruction and maintenance of connundrum
1
restart tabust when changing screen orientation
1
Android app not showing in portrait mode when displaying via HDMI
1
Android onStop onDestroy called after onCreate
0
Android Orientation Change (onConfigurationChanged / OrientationEventListener)
0
How to keep Android rotation landscape always



All Articles
Loading...
X
Show
Funny
Dev
Pics