android - How to know make notification when user doesn't executing application -


i'd make notification start count time when user exited android application. if user not executed application after 1hours, notified me execute , if user ignoring it, executes saved sms messages. found examples on timer, not know how find application exit time. please give me advice full code. desperately need it...

timertask task = new timertask(){     public void run() {         try {             maintime++;             int min = maintime / 60;             int sec = maintime % 60;             string strtime = string.format("%s : %s", min, sec);         } catch (exception e) {             e.printstacktrace();         }     } };  timer mtimer = new timer(); mtimer.schedule(task, 0, 60000); intent sendintent = new intent(intent.action_view); sendintent.putextra("chack app", smsbody);                  sendintent.putextra("12345678", phonenumber);                sendintent.settype("vnd.android-dir/mms-sms"); startactivity(sendintent); 

okay need store system time locally (may using sharedpreferences) when application exits. can register broadcastreceiver trigger action when 1hr or time has passed locally stored time when app exited.

if want know how handle programmatically when , how exit app , please refer this answer.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -