0
以下是我正在創建消息的通知「喚醒喚醒!!!」 當通知發生在特定的時間和用戶點擊它時,我想要做什麼,我需要得到那個消息「喚醒喚醒!!!」併發送至SnoozeActivity我在哪裏創建自定義警告對話框,我想證明消息到該對話框獲取通知消息併發送到活動
alarmNotificationManager = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, SnoozeActivity.class), 0);
NotificationCompat.Builder alamNotificationBuilder = new NotificationCompat.Builder(
this).setContentTitle("Alarm").setSmallIcon(R.drawable.ic_launcher)
.setStyle(new NotificationCompat.BigTextStyle().bigText("wake up wake up !!!"))
.setContentText(msg).setAutoCancel(true);
alamNotificationBuilder.setContentIntent(contentIntent);
alarmNotificationManager.cancelAll();
alarmNotificationManager.notify(1, alamNotificationBuilder.build());
,但我無法弄清楚如何獲得點擊通知的消息/數據和發送到下一個活動?
使用該 – Dhiraj
@Dhiraj越來越空 - 忘記「PendingIntent.FLAG_UPDATE_CURRENT」,現在的工作我的樣本 – 0X0nosugar
完美的.... ... !!!!!!!!!! – Dhiraj