我完成了这个
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才能完美运行。顶部的通知图标显示白色圆圈。我该怎么办? 当我从顶部拖动时,通知在其中看起来很正常。
答案 0 :(得分:0)
http://developer.android.com/design/patterns/notifications.html
在该页面上,您可以在“请勿”下看到,您的通知图标应该只有两种颜色:透明背景上的白色。下拉通知中的图标不同,限制较少。