我正在使用 AlarmManager() 来触发通知。但不知道如何在上午 10 点和每 24 小时点火一次。任何人请帮助我。
我的代码如下:
Calendar Calendar_Object = Calendar.getInstance();
Calendar_Object.set(Calendar.HOUR_OF_DAY, 10);
Calendar_Object.set(Calendar.MINUTE, 00);
Calendar_Object.set(Calendar.SECOND, 0);
Intent myIntent = new Intent(Splash.this, AlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(Splash.this, 0, myIntent, 0);
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC,Calendar_Object.getTimeInMillis(),(24 * 60 * 60 * 1000),pendingIntent);