0

I had a problem running my app on Nexus 6p: My Android app is getting killed every time my app is moving to background.

I have already set this app to be 'Not Optimized' and made reboot - but still had no success. I see that my Activity's onDestroy() is called for every time..

Any idea?

halfer
  • 19,824
  • 17
  • 99
  • 186
lior
  • 11
  • 1
  • 1
    if it crashes show logcat , and also show the code where the crash happens – yanivtwin Sep 07 '17 at 09:05
  • Is it working fine on other phones? – Suhayl SH Sep 07 '17 at 09:05
  • Please share if you've got any exceptions. It'll be helpful to find out the issue. – Nagaraj N Sep 07 '17 at 09:06
  • Do your Nexus 6P have Android O? If yes then you have to Read some articles regarding Android O – Rakshit Nawani Sep 07 '17 at 09:22
  • currently It crashes since the app assumes the activity is not destroyed - I can handle it but I do not want to restart my activity each time app goes to bg. the app is properly running on other HUAWEI p9 and more devices (this is the only one I have problems with) . I'm trying to figure out why the activity is being destroyed on this device. – lior Sep 07 '17 at 09:49
  • It is just normal behavior, Android may shut down apps when it needs the resources (memory for example). Your App must be able to deal with it. – Henry Jan 08 '18 at 12:49

1 Answers1

0

I don't think there is any way or reason to run app in background. This link shows how to run tasks in background. If your use case doesn't fit in scenarios described there, please provide it in problem.

rushi
  • 142
  • 1
  • 12