2017-03-07 62 views
1

目前我有這樣的:如何打開通知組非發射活動點擊

Intent resultIntent = new Intent(context, DigestPager.class); 

,這是開放DigestPager活動(這是不發射活動)的一個通知,當點擊。

但是,當有多個通知,他們被分組到一個和摺疊,點擊它打開啓動器的活動。

是否有一些簡單的方法來打開不同的活動?

Intent resultIntent = new Intent(context, DigestPager.class); 
resultIntent.putExtra("digestId", digest.getDigestId()); 

PendingIntent pendingIntent = PendingIntent.getActivity(this, digest.getDigestId(), resultIntent, 
      PendingIntent.FLAG_UPDATE_CURRENT); 

mBuilder.setContentIntent(pendingIntent); 

NotificationManager mNotifyMgr = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE); 

mNotifyMgr.notify(digest.getDigestId(), mBuilder.build()); 
+0

你可以打開使用PendaingIntents.Try它 –

+0

這就是我目前使用的。單擊通知單擊。 –

+0

[點擊通知去當前活動]可能重複(http://stackoverflow.com/questions/16885706/click-on-notification-to-go-current-activity) – Kota1921

回答

0

創建每次打開你的通知點擊並根據設定通知的標誌,你可以瀏覽到所需的活動/片段的處理活動。

希望這會有所幫助。

+0

事情是,我不能處理通知組點擊時的意圖。這是開放發射器活動,並沒有通過任何額外的。 –

+0

發佈代碼。它可能有一個問題。 –