问题描述
- mNotification=new Notification(); icon怎么设置
-
mNotification=new Notification();
mNotification.icon=icon ; ???这个icon怎么设置?
解决方案
Notification notification = new NotificationCompat.Builder(context)
.setLargeIcon(icon).setSmallIcon(R.drawable.ic_launcher)
.setTicker("showNormal").setContentInfo("contentInfo")
.setContentTitle("ContentTitle").setContentText("ContentText")
.setNumber(++messageNum)
.setAutoCancel(true).setDefaults(Notification.DEFAULT_ALL)
.build();
manager.notify(NOTIFICATION_ID_1, notification);
解决方案二:
//设置通知在状态栏显示的图标
mNotification.icon=R.drawable.icon;
时间: 2024-11-02 22:21:45