0

I'm making a Kiosk app. I set my app as default launcher. The app works automatically every day from 8:00 AM to 11:00 PM then go to sleep until next 8:00 AM. I wonder would android kill my suspended app when device goes to sleep? if OK, How should I prevent it?

Shervin Gharib
  • 728
  • 2
  • 14
  • 29
  • I assume it would get killed. But why do you want to prevent this? You could instead save your instance state when your app is being killed, and then restore completely when it is started again. You should also take special care for static objects, singletons etc. – dragi Jul 07 '15 at 13:05
  • Thank you, what do you mean by take special care for static objects and singletons? – Shervin Gharib Jul 07 '15 at 13:17
  • You can check this link: http://www.developerphil.com/dont-store-data-in-the-application-object/ (Application is a singleton), as well as this SO: http://stackoverflow.com/questions/3826905/singletons-vs-application-context-in-android – dragi Jul 07 '15 at 13:41

1 Answers1

0

After many long running test I found that Android does not kill process or even call onDestroy of custom home launcher app when device goes to sleep.

Shervin Gharib
  • 728
  • 2
  • 14
  • 29