Я работаю с кодом FCM, поэтому уведомления работают отлично, но мой вопрос: всякий раз, когда мое приложение находится на переднем плане, в это время оно отображает значки, но если мое приложение находится в фоновом режиме или не открыто в это время, оно отображает пустые белые значки.
, поэтому в целях проверки дрожания, приведенного ниже кода, я прокомментировал метод notify для построителя уведомлений, хотя Notification происходит почему?
Notification notificationBuilder = mBuilder
.setSmallIcon(R.drawable.brandlogo)
.setTicker(title)
.setContentTitle(title)
.setContentText(message)
.setAutoCancel(true)
.setColor(Color.parseColor("#126eb5"))//#126eb5
.setLargeIcon(result)
.setStyle(new NotificationCompat.BigTextStyle().bigText(message))
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent).build();
int smallIconId = getApplicationContext().getResources().getIdentifier("right_icon", "id", android.R.class.getPackage().getName());
if (smallIconId != 0) {
if (notificationBuilder.contentView != null) {
notificationBuilder.bigContentView.setViewVisibility(smallIconId, View.INVISIBLE);
}
}
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
//notificationManager.notify(NCount++, notificationBuilder);