2017-03-07 100 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

发布代码。它可能有一个问题。 –