My app is a voip app. I am using NotificationCompat.CallStyle
in NotificationCompat.Builder
. The smallIcon
I gave in it does not appear. My phone is Android 13.
Also, the icon appears in the dark theme. Icon not visible without dark theme. Even if I give the light theme an irrelevant blue color, it doesn't show up.
There is only color difference between dark and light.
Dark theme color:
android:fillColor="#ffffff"
Light theme color:
android:fillColor="#000000"
My light baseline_phone_callback_24 icon:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20.156,3.703L13.828,9.984L18,9.984L18,11.016L12,11.016L12,5.016L12.984,5.016L12.984,9.281L19.453,3L20.156,3.703ZM6.609,10.781C8.109,13.688 10.313,15.891 13.219,17.391L15.422,15.188C15.734,14.875 16.078,14.797 16.453,14.953C17.578,15.328 18.766,15.516 20.016,15.516C20.297,15.516 20.531,15.609 20.719,15.797C20.906,15.984 21,16.219 21,16.5L21,20.016C21,20.297 20.906,20.531 20.719,20.719C20.531,20.906 20.297,21 20.016,21C15.328,21 11.32,19.336 7.992,16.008C4.664,12.68 3,8.672 3,3.984C3,3.703 3.094,3.469 3.281,3.281C3.469,3.094 3.703,3 3.984,3L7.5,3C7.781,3 8.016,3.094 8.203,3.281C8.391,3.469 8.484,3.703 8.484,3.984C8.484,5.234 8.672,6.422 9.047,7.547C9.172,7.953 9.094,8.297 8.813,8.578L6.609,10.781Z"
android:strokeWidth="1"
android:fillColor="#000000"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
</vector>
My notification builder:
builder = new NotificationCompat.Builder(this, getNotificationChannel(type))
.setCategory(NotificationCompat.CATEGORY_CALL)
.setOngoing(true)
.setSmallIcon(R.drawable.baseline_phone_callback_24);
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
Person person = Person person = new Person.Builder()
.setName(friendName)
.setImportant(true)
.build();
builder.setStyle(CallStyle.forIncomingCall(person, pendingIntent1, pendingIntent2);
Dark theme: