当警报被调用时,不从意图获取数据

时间:2017-11-17 13:22:07

标签: android

我在触发警报时安排通知。下面是代码

{{ form.instance.layout.thumbnail }}
{{ form.instance.layout.padding_top }}

这就是我收到它的方式

Intent alarmIntent = new Intent(this, OnConferenceAlarmReceiver.class);
    byte[] bytes = ParcelableUtil.marshall(entity);
    alarmIntent.putExtra(KEY_CONFERENCE_ENTITIY, bytes);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,  alarmIntent, PendingIntent.FLAG_ONE_SHOT);
    alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);

这是可以分辨的

void popUpMeetingNotification(Intent intent) {
    LogUtil.d("MeetingReminderService : Showing the Notification ");
    Bundle extras = intent.getExtras();
    ConferenceEntity entity = null;
    if (extras != null) {
        byte[] bytes = extras.getByteArray(KEY_CONFERENCE_ENTITIY);
        Parcel parcel = ParcelableUtil.unmarshall(bytes);
        entity = new ConferenceEntity(parcel);
    }

}

我没有从意图中获取额外数据

先谢谢

0 个答案:

没有答案