android - how can i use this for every hour? now its working every day 16.30 -
i'm creating notification system need give notification every hour it's giving 1 day
protected void onstart() { super.onstart(); calendar calendar = calendar.getinstance(); calendar.set(calendar.hour_of_day, 16); calendar.set(calendar.minute, 30); intent intent = new intent(getapplicationcontext(),notificationreceiver.class); pendingintent pendingintent = pendingintent.getbroadcast(getapplicationcontext(),100,intent,pendingintent.flag_update_current); alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); alarmmanager.setrepeating(alarmmanager.rtc_wakeup,calendar.gettimeinmillis(),alarmmanager.interval_day,pendingintent); }
you using alarmmanager.interval_day
execute every 24h change alarmmanager.interval_hour
Comments
Post a Comment