0

I'm facing this strange issue, I'm using Google Notification Manager to Post Popup notification on TV,

The Problem is Like this.

  1. Post Notification X which is seen properly [has a timeout of 5 seconds]
  2. During the notification X is seen if 2nd Notification Y is Posted,
  3. Second Notification Y Reappears/seen twice.

Code Snippet is below.

I have tried following things to fix it. I don't find any more question or problem fixes on web,

A>Reduce TimeOut B>Cancel Notification X before calling Notification Y

   private static void postGtvNotification(final Context context, String ABC, final int notificationId,) {
    mNotificationManager = context.getSystemService(NotificationManager.class);
        cancelAllGtvNotifications(); //Cancel the old notification if any 
        String channelId = createNotificationChannel(mNotificationManager);
        Notification.Builder builder = new Notification.Builder(context, channelId)
                .setSmallIcon(smallIconResid)
                .setContentTitle(title)
                .setVisibility(Notification.VISIBILITY_PUBLIC)
                .setLocalOnly(true)
                .setCategory(Notification.CATEGORY_SYSTEM)
                .setTimeoutAfter(5000)
                .extend(new Notification.TvExtender().setChannelId(channelId));
                mNotificationManager.notify(notificationId, builder.build());
        Log.d(TAG," notificationId "+notificationId";
    }

Thank you for the help. any suggestions are welcome.

Arun Sudhakaran
  • 2,167
  • 4
  • 27
  • 52
128041
  • 1
  • 2

0 Answers0