Changing the image on the smartwatch notification

Viewed 20

I'm developing a simple app for Android. I would like to change the image of my notifications on Samsung Galaxy Watch smartwatch. I tried to do it like this, unfortunately it doesn't work. In addition, the setBackround method is deprecated. Please help.

NotificationCompat.WearableExtender extender = new NotificationCompat.WearableExtender();
                Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.logo);
                extender.setBackground(bitmap);

                notificationn = new NotificationCompat.Builder(getApplicationContext(),WateringChannel.ID_OF_CHANNEL_2)
                        .setSmallIcon(R.drawable.icon_drop_of_water)
                        .setContentTitle("Tura " + sharedPreferences.getInt(SharedPreferencesNames.WateringData.ACTUAL_ROUND,1))
                        .setContentText("Pozostały czas: " + ToolClass.generateCountDownTimerTime(millisUntilFinished/1000))
                        .setPriority(NotificationCompat.PRIORITY_LOW)
                        .setOngoing(true)
                        .setOnlyAlertOnce(true)
                        .extend(extender);

                notificationManager = NotificationManagerCompat.from(getApplicationContext());
                notificationManager.notify(2, notificationn.build());
0 Answers
Related