3

I am aware of the fact that this problem has been reported earlier and I have used all the recommended solutions but none has helped so far.

As mentioned in the title, onDestroy() is called every time screen turns off. It doesn't happen if a service is ON.

Application has fixed orientation and hence

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:

  1. We are facing the problem only on one device in our test setup, Samsung Duo running 4.0.4. On all other devices, this is not an issue.
  2. This issue is not happening with other apps running on the same device.

Will appreciate your help.

Thanks

Update: It seems that setting these flag is causing the issue. Removing them solves but they were used for a reason so any other insight will be appreciated.

Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY
mesibo
  • 3,970
  • 6
  • 25
  • 43
  • What Android version do you target? I would try to add also `screenSize` into manifest configChanges, but I am not sure about solving your problem with it. – Berťák Jul 23 '15 at 11:46
  • Thanks, already tried. Not helping. Target api level >= 8 – mesibo Jul 23 '15 at 11:46
  • What your app does ? Using any `WakeLocks` or something ? – Jibran Khan Jul 23 '15 at 11:51
  • No, it's just a simple login activity. – mesibo Jul 23 '15 at 12:01
  • Having the same issue too. I call an activity from an Intent in a Service. Have you solved this issue yet? – XMAN Oct 23 '17 at 16:18
  • 1
    @XO I posted an update (pls see bottom of the post), see if it helps – mesibo Oct 25 '17 at 05:04
  • @yumoji: Thanks for the response! I did try it- and found out the other night that my issue was related to 'android:noHistory="true"' in the Manifest file. Once removed, the activity was no longer being destroyed. I wonder if there's any relations between our solutions? – XMAN Oct 25 '17 at 14:35
  • @yumoji Sorry, ay late in seeing the update. REsumed development, I'll confirm when I get a change. – XMAN Dec 10 '18 at 00:58

0 Answers0