android - Alarm Manager - triggers after every 2 hours -



android - Alarm Manager - triggers after every 2 hours -

i have next piece of code gets called once. notification gets triggered after every 2 hours want triggered after 2 days. tried options, still not working

public int setalarm(){ calendar calendar_object = calendar.getinstance(); /* calendar_object.set(calendar.month,6); calendar_object.set(calendar.year, 2013); calendar_object.set(calendar.day_of_month, 18);*/ // myview current activity, , alarmreceiver // boradcastreceiver intent myintent = new intent(splash.this, timealarm.class); pendingintent pendingintent = pendingintent.getbroadcast(this, 0, myintent, pendingintent.flag_cancel_current); long wkuptime = calendar_object.gettimeinmillis() + 36000; alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); // log.w("alarm set " , calendar_object.gettime().tostring ()); /* * next sets alarm in specific time getting long * value of alarm date time in calendar object calling * gettimeinmillis(). since alarm supports long value , we're * using method. */ // alarmmanager.setrepeating(alarmmanager.rtc, calendar_object.gettimeinmillis(),1000 *24*3600, // pendingintent); alarmmanager.setrepeating(alarmmanager.rtc_wakeup, wkuptime , 172800000, pendingintent); homecoming 0;

public int setalarm() { calendar calendar_object = calendar.getinstance(); intent myintent = new intent(splash.this, timealarm.class); pendingintent pendingintent = pendingintent.getbroadcast(this, 0, myintent, pendingintent.flag_cancel_current); long wkuptime = calendar_object.gettimeinmillis() + 72000; alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); alarmmanager.setrepeating(alarmmanager.rtc_wakeup, wkuptime ,7200000, pendingintent); homecoming 0; }

android alarmmanager

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -