我需要使用通知點擊事件,我有通知方法,但這種方法不打開我的活動。我怎樣才能打開活動時通知點擊
我的代碼:
private void sendNotification(String msg) {
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setContentTitle("EXX")
.setSmallIcon(R.drawable.ic_launcher)
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(msg))
.setContentText(msg)
.setOngoing(true);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
這是可能的,
感謝。
的可能的複製13716723 /點擊通知後打開應用程序) –
不重複。 OP只是缺少'setContentIntent()' –