我使用以下代碼獲取Notificaiton圖標。這給出了正常的通知圖標,但在其右下角有一個小白盒。我怎樣才能爲此設置圖標。在通知圖標中添加小圖標
public void not() {
Notification noti = new Notification.Builder(context).setSmallIcon(R.mipmap.lnc)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.lnc))
.setContentTitle("My Title")
.setContentText("Done").setSmallIcon(R.mipmap.lnc)
.build();
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
// hide the notification after its selected
noti.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(0, noti);
}
所以我有一個主圖標,然後在右下角,並在一個白色的盒子一圈。 Setcolor將圓圈的顏色從默認的灰色設置爲所選的顏色,儘管白色框保持白色。 – Panache
不會有任何白盒,那麼會有一個背景顏色設置的圓圈,裏面會是你創建的白色圖標。 –
是的,實際上我使用的是mipmap圖標而不是可繪製的。現在我可以看到我的小圖標。 – Panache