我做到了
Notification.Builder notificationBuilder = new Notification.Builder( getApplicationContext()); RemoteViews mContentView = new RemoteViews( getApplicationContext().getPackageName(), R.layout.custom_notification); Uri alertSound = RingtoneManager .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); notificationBuilder.setSound(alertSound); mContentView.setTextViewText(R.id.text, getResources() .getString(R.string.activation_code) + ": " + mUUID); notificationBuilder.setContent(mContentView); notificationBuilder.setContentTitle(getResources() .getString(R.string.activation_code)); notificationBuilder .setSmallIcon(R.drawable.ic_launcher); notificationBuilder.setAutoCancel(true); NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(11151990, notificationBuilder.getNotification());
非常简单,这很完美,直到今天我得到了我的 Nexus 7 棒棒糖操作系统。 顶部的通知图标显示白色圆圈。我该如何解决这个问题?当我从顶部拖动时,通知在里面看起来很正常。
http://developer.android.com/design/patterns/notifications.html
在该页面上,您可以在"不要"下看到,您的通知图标应该只有两种颜色:透明背景上的白色。下拉通知中的图标是不同的图标,限制较少。