on all Huawei, Honor, Xiaomi with Android Marshmallow (custom ROM for dual SIM), the setSmallIcon notification setSmallIcon always set to the default application activity icon, I could not put it properly, the setLargeIcon icon works fine. API 21 and 23 tested. Does anyone have working code?
test(R.drawable.ic_mynotificon, "Test"); private void test(int resID, String txt) { final NotificationManagerCompat mNotificationManager = NotificationManagerCompat.from(getContext()); final NotificationCompat.Builder notif_builer = new NotificationCompat.Builder(getContext()) .setContentTitle(txt) .setContentText(txt) .setSmallIcon(resID) .setDefaults(NotificationCompat.DEFAULT_ALL); mNotificationManager.notify(999, notif_builer.build()); return; }
source share