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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -