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_keygua‌​rd);         wind.addflags(windowmanager.layoutparams.flag_show_when_lock‌​ed);         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

  1. the user opens activity.
  2. oncreated() called
  3. onstart() called
  4. onresume() called
  5. the user locks device onpause called()
  6. the user unlocks device onresume() called

Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -