4
The constructor to AlarmManager.AlarmClockInfo
需要PendingIntent
,描述爲「可用於顯示或編輯鬧鐘細節的意圖」。系統在哪裏使用?我沒有看到任何似乎觸發PendingIntent
的Android 6.0用戶界面。AlarmManager.AlarmClockInfo中的PendingIntent用於何處?
The constructor to AlarmManager.AlarmClockInfo
需要PendingIntent
,描述爲「可用於顯示或編輯鬧鐘細節的意圖」。系統在哪裏使用?我沒有看到任何似乎觸發PendingIntent
的Android 6.0用戶界面。AlarmManager.AlarmClockInfo中的PendingIntent用於何處?
的PendingIntent
是getShowIntent()
在AlarmManager.AlarmClockInfo返回:
public PendingIntent getShowIntent() {
return mShowIntent;
}
而且它在onClick()
方法StatusBarHeaderView使用:
PendingIntent showIntent = mNextAlarm.getShowIntent();
if (showIntent != null && showIntent.isActivity()) {
mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */);
}
在視覺上,用戶點擊的東西來調用PendingIntent
是鬧鐘的日期/時間,如下圖灰色在鬧鐘圖標的右側所示:
感謝您指出掛起的意圖應該啓動一項活動。現在我明白了爲什麼我的'BroadcastReceiver'根本沒有收到任何東西。 – Nikolai