不要设置通知图标

时间:2016-12-18 16:35:53

标签: android notifications

不是我想要设置的图标,而是始终显示标准的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());

0 个答案:

没有答案