I can see my group of notification on notification bar; fired from Firebase and I want to implement Expandable view of notifications. I am using This link
but I can't implement this because when I click to notifications it open my activity This is my ShowNotification() method
private void showNotificationMessage(Context context, String title, String message, String timeStamp, Intent intent) {
notificationUtils = new NotificationUtils(context);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
notificationUtils.showNotificationMessage(title, message, timeStamp, intent);
}
And here is code for Notification Builder
MyFirebaseMessagingService.notificationMessages.add(message);
mBuilder = new NotificationCompat.Builder(mContext)
.setContentTitle(title)
.setContentText(message)
.setAutoCancel(false)
.setSmallIcon(icon)
// .setCustomContentView(remoteViews)
// .setCustomBigContentView(remoteViews)
.setContentInfo("" + (MyFirebaseMessagingService.notificationMessages.size()))
.setGroup(GROUP_KEY);
please suggest me Any intent.Flag or other code so that I can stop activity to be opened on notification click.
Just remove the below line:
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
And pass 0 instead of intent:
notificationUtils.showNotificationMessage(title, message, timeStamp, 0);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments