1

I have simple application that sends notifications, which I want to show on Samsung Watch (Active 2). The notification itself is shown on watch, but I cannot get Icon to be displayed. Here is example of notification from gmail and from my app. On gmail (left) you can see icon of the app, while on the right you cannot. What am I missing?

notification-shown

Relevant code I use is below:

    int notificationId = 001;
    Bitmap bIcon = BitmapFactory.decodeResource( getResources(),R.drawable.ic_stat_ic_notification);

    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId)
            .setSmallIcon(R.drawable.ic_stat_ic_notification)
            .setLargeIcon(bIcon)
            .setContentTitle(title)
            .setContentText(message)
            .setAutoCancel(true)
            .setSound(defaultSoundUri)
            .setContentIntent(pendingIntent);

    NotificationCompat.WearableExtender wearableExtender =
            new NotificationCompat.WearableExtender().setContentAction(0);

    notificationBuilder.extend(wearableExtender);

    NotificationManager notificationManager =
            (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        NotificationChannel channel = new NotificationChannel(channelId,
                "Home Notifier",  NotificationManager.IMPORTANCE_DEFAULT);
        notificationManager.createNotificationChannel(channel);
    }

    notificationManager.notify(notificationId /* ID of notification */, notificationBuilder.build());
Yuri Schimke
  • 12,435
  • 3
  • 35
  • 69
Marko
  • 115
  • 4
  • This is not of interest to me anymore, as I upgraded my watch few months back, but I can only add that once I switched to newer watch, the same code does produce the icon. I am guessing I needed to put different size icon on the resources or something like that. – Marko Jul 03 '23 at 07:31

0 Answers0