不是我想要设置的图标,而是始终显示标准的ic_launcher。尝试和矢量图像,和一个png。
出了什么问题?
NotificationCompat.Builder notifADBStarted = new NotificationCompat.Builder(this)
.setContentTitle(getResources().getString(R.string.server_is_active))
.setContentText("adb connect" + " " + usersIP.getIpAddress())
.setSmallIcon(R.drawable.ic_wifi_tethering_white_24dp)
.setTicker(getResources().getString(R.string.server_is_active))
.setLargeIcon(BitmapFactory.decodeResource(getApplicationContext().getResources(), R.drawable.ic_wifi_tethering_black_24dp))
.setContentIntent(pIntent);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
notifADBStarted.setPriority(Notification.PRIORITY_MAX);
}
notificationManager.notify(0, notifADBStarted.build());