AlarmManger不起作用

时间:2016-11-26 15:33:39

标签: java android alarmmanager

当我使用日历时,它不起作用!

    Calendar cal = Calendar.getInstance();
    cal.set(2016, 11 , 28);
    Intent intent = new Intent(this, MyBroadcastReceiver.class);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(
            this.getApplicationContext(), 54, intent, 0);
    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
    alarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis() , pendingIntent);

0 个答案:

没有答案