Android通知图标未在letv中显示

时间:2017-02-02 11:48:50

标签: android notifications android-6.0-marshmallow

我正在设置小型和大型通知图标,但它显示我尚未设置的默认应用程序图标。所以请帮助我。谢谢..

以下是代码:

 android.support.v4.app.NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
                .setSmallIcon(R.drawable.notification)
                .setLargeIcon(artwork)
                .setContentIntent(clickIntent)
                .setContentTitle(getTrackName())
                .setContentText(text)
                .setWhen(mNotificationPostTime)
                .addAction(R.drawable.ic_skip_previous_white_36dp,
                        "",
                        retrievePlaybackAction(PREVIOUS_ACTION))
                .addAction(playButtonResId, "",
                        retrievePlaybackAction(TOGGLEPAUSE_ACTION))
                .addAction(R.drawable.ic_skip_next_white_36dp,
                        "",
                        retrievePlaybackAction(NEXT_ACTION));

这是letv的快照(有问题enter image description here):

这是Genymotion仿真器的快照(预期输出):

enter image description here

两者都在Android 6.0(Api等级23)上运行

1 个答案:

答案 0 :(得分:0)

在您的清单文件中添加此元数据,然后您可以更改默认通知图标。

<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/ic_stat_ic_notification" />