android - Bring Application from background to front -
i trying make simple project move application background using
public boolean onkeydown(int keycode, keyevent event) { if(keycode == keyevent.keycode_back){ movetasktoback(true); } return super.onkeydown(keycode, event); } and trying bring application front, displaying on screen automatically though user didn't reopen application
for example, set timeout 30 seconds, close application (which moved background actually), after 30 seconds, application automatically move front , shows text "time out". if playing games during time out, game pause , display time out page, tried search solutions result quite disappointing. below codes using bring page front, display in app, unless user reopen app onli can see time out page otherwise not know
intent intent = new intent("com.lolcash.lol.popout"); intent.addflags(intent.flag_activity_new_task|intent.flag_activity_single_top|intent.flag_activity_reorder_to_front); startactivity(intent); is there other way that?
try create service, run in background. when want bring activity front can start service. solution display notification message, when user tap can take him app.
Comments
Post a Comment