Calendar cal = Calendar.getInstance();
cal.add(Calendar.SECOND, 10);
Intent intent = new Intent(Login_activity.this, EnqueryNotification_Service.class);
PendingIntent pintent = PendingIntent.getService(Login_activity.this, 0, intent, 0);
AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarm.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 36000 * 1000, pintent);
这个cal.add(Calendar.SECOND, 10);
10代表什么?
答案 0 :(得分:2)
cal.add(Calendar.SECOND, 10);
为当前的Calendar实例添加10秒。
答案 1 :(得分:0)
使用此功能,您将为此日历对象添加10秒。您应该查看Calendar API Reference
干杯