我的应用程序中的通知栏仅在滚动条中显示小图标(应该如此)。但是,当“下拉”时,它将同时显示来自滚动条的小图标和我在Notification.Builder中设置的大图标。这是我的代码:
if (Build.VERSION.SDK_INT > 10){
notification = new Notification(R.drawable.ic_stat_mintchip,
"This is a test",
System.currentTimeMillis());
notification.largeIcon = (((BitmapDrawable)c.getResources().getDrawable(R.drawable.ic_launcher)).getBitmap());
notification.defaults |= Notification.DEFAULT_ALL;
notification.number += 1;
notification.flags |= Notification.FLAG_AUTO_CANCEL;
} else {
notification = new Notification(R.drawable.ic_stat_mintchip,
"This is a test",
System.currentTimeMillis());
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.defaults |= Notification.DEFAULT_ALL;
notification.number += 1;
}
}
我不太清楚为什么会发生这种情况。有什么帮助吗?
Notification.Builder
,但是你的代码并没有使用它。你可以考虑使用来自Android支持库项目的NotificationCompat.Builder
,看看是否有所帮助。 - CommonsWare