【发布时间】:2013-04-23 13:29:05
【问题描述】:
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
int icon = R.drawable.ic_notification_icon;
android.app.Notification.Builder nbuilder = new Notification.Builder(this);
nbuilder.setContentTitle(getString(R.string.notifcation_title,mProfile.mName));
nbuilder.setContentText(msg);
nbuilder.setOnlyAlertOnce(true);
nbuilder.setOngoing(true);
nbuilder.setSmallIcon(icon,level.level);
如何隐藏或完全删除 smallIcon?我试过不使用nbuilder.setSmallIcon,结果是通知根本不显示!
【问题讨论】:
-
我知道的唯一方法是为图标使用透明图像,然后设置通知的顺序,以便您的通知排在最后(最右边),这将使用户看起来好像没有图标。
-
为什么这符合用户的利益?
-
@CommonsWare :一个用例:一个隐身运行的通信应用程序确实希望用户知道消息何时到达,但不想显示应用程序图标或任何图标,以便其他人不能见。
标签: android android-notifications