Android 如何在棒棒糖中设置通知图标?
我无法在通知栏中获取应用程序图标。Android 如何在棒棒糖中设置通知图标?,android,notifications,icons,android-5.0-lollipop,Android,Notifications,Icons,Android 5.0 Lollipop,我无法在通知栏中获取应用程序图标。 我想在通知图标中设置我的应用图标。 我该怎么做 NotificationCompat.Builder mBuilder=新建NotificationCompat.Builder(上下文) .图标(图标) 我得到了应用程序图标的白色图标实例,我也有同样的问题,主要是不支持大小的问题。希望这能有所帮助 Notification noti = new NotificationCompat.Builder(context) .setCo
我想在通知图标中设置我的应用图标。
我该怎么做 NotificationCompat.Builder mBuilder=新建NotificationCompat.Builder(上下文) .图标(图标)
我得到了应用程序图标的白色图标实例,我也有同样的问题,主要是不支持大小的问题。希望这能有所帮助
Notification noti = new NotificationCompat.Builder(context)
.setContentTitle("DPD News")
.setSmallIcon(R.drawable.YOURICON_SMALL) // this is the icon that show in notification are before drage down, small icon. this has to be 25px X 25px
.setLargeIcon(LARGE_ICON) // i have use the same sizes of ic_launcher to this
.setContentText("MESSAGE")
.setContentIntent(pi) // pending intent if needed
.setAutoCancel(true)
.build();
发布你已经尝试过的代码。你在这个链接中找到了吗