java - onResume in android Service -


in application have service creates threads. when device goes in sleep mode, threads interrupted , destroyed. assuming cannot use activity's onresume() (because using standout library , standoutwindow extends service), how can recreate/restart threads when wake device?

would catching screen on/off intents idea?

system suspend should not destroy thread, put thread suspend. thread should not running, if need finish job, grasp weak lock.

you can register runtime broadcast receiver watch screen on/off state handle it. normal approach.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -