java - onResume in android Service -
in application have service
creates thread
s. 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 thread
s when wake device?
would catching screen on/off intent
s 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
Post a Comment