0

I have a sticky service. As a test, I have throw runtime exception. Strangely, when the "App has stopped working" dialog pops up on the homescreen, if I press ok, the service seems restart or continue running. If I don't press okay and leave the dialog on the screen, the Service seems to be killed and never comes back. Can anyone explain this, and how to have my service restart itself?

A.Sanchez.SD
  • 1,950
  • 2
  • 18
  • 23
  • `if I don't press okay and leave the dialog on the screen, the Service seems to be killed and never comes back.` what are you trying to achieve? the dialog will not to stay on screen forever (user will dismiss it either by pressing ok or clicking outside the dialog! – Muhammad Babar Feb 12 '16 at 07:25

1 Answers1

1

The key is to use an UncaughtExceptionHandler. Try this to see how it can be done!

Community
  • 1
  • 1
OBX
  • 6,044
  • 7
  • 33
  • 77