android - Handler not workig when device is locked screen -
activity open when device lock screen problem inside activity using handler showing dialog not working. handler working when device unlock dialog showing.my problem when device screen unlock want start handler inside activity showing dialog.
here code:
protected void oncreate(bundle savedinstancestate) { requestwindowfeature(window.feature_no_title); wind = this.getwindow(); wind.addflags(windowmanager.layoutparams.flag_dismiss_keyguard); wind.addflags(windowmanager.layoutparams.flag_show_when_locked); wind.addflags(windowmanager.layoutparams.flag_turn_screen_on); wind.addflags(windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.activity_incoming_call); mhandler_calldismiss=new handler(); mhandler_calldismiss.postdelayed(runnable,30000); }
in activity, befor lock, calls onpause() , after unlock , calls onresume(). can write handler code in onresume() functions
- the user opens activity.
- oncreated() called
- onstart() called
- onresume() called
- the user locks device onpause called()
- the user unlocks device onresume() called
Comments
Post a Comment