0
當方法getBroadcast被調用時,PendingIntent發送廣播。Android:PendingIntent最初發送廣播,如何最初不播放?
AlarmManager alarmManager = (AlarmManager)this.getSystemService(ALARM_SERVICE);
Intent alarmIntent = new Intent(Constants.ALARM_ACTION);
PendingIntent mPendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, getMidnight()
.getTimeInMillis(), mPendingIntent);
我希望廣播只在鬧鐘響鈴時才發送,而不是在調用getBroadcast時發送,但鬧鐘需要一個待處理的意圖。有任何想法嗎?