简体   繁体   English

AlarmManager.AlarmClockInfo中的PendingIntent在哪里使用?

[英]Where Does the PendingIntent in AlarmManager.AlarmClockInfo Get Used?

The constructor to AlarmManager.AlarmClockInfo takes a PendingIntent , described as "an intent that can be used to show or edit details of the alarm clock". AlarmManager.AlarmClockInfo的构造AlarmManager.AlarmClockInfo采用PendingIntent ,描述为“可用于显示或编辑闹钟细节的意图”。 Where is this used by the system? 系统在哪里使用? I don't see anything in the Android 6.0 UI that would seem to trigger that PendingIntent . 我没有在Android 6.0 UI中看到任何似乎触发PendingIntent

The PendingIntent is returned by getShowIntent() in AlarmManager.AlarmClockInfo : PendingIntentgetShowIntent() 返回

public PendingIntent getShowIntent() {
    return mShowIntent;
}

and it's used in the onClick() method of StatusBarHeaderView : 它在StatusBarHeaderViewonClick()方法中使用:

PendingIntent showIntent = mNextAlarm.getShowIntent();
if (showIntent != null && showIntent.isActivity()) {
    mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */);
}

Visually, the thing the user clicks on to invoke the PendingIntent is the date/time of the alarm, shown in the following screenshot in grey to the right of the alarm clock icon: 在视觉上,用户点击以调用PendingIntent是警报的日期/时间,如下面的屏幕时间图标右侧灰色屏幕截图所示:

Android 6.0通知阴影,显示待处理的闹钟

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM