<tfoot id='5uwGZ'></tfoot>

  1. <small id='5uwGZ'></small><noframes id='5uwGZ'>

    1. <legend id='5uwGZ'><style id='5uwGZ'><dir id='5uwGZ'><q id='5uwGZ'></q></dir></style></legend>
    2. <i id='5uwGZ'><tr id='5uwGZ'><dt id='5uwGZ'><q id='5uwGZ'><span id='5uwGZ'><b id='5uwGZ'><form id='5uwGZ'><ins id='5uwGZ'></ins><ul id='5uwGZ'></ul><sub id='5uwGZ'></sub></form><legend id='5uwGZ'></legend><bdo id='5uwGZ'><pre id='5uwGZ'><center id='5uwGZ'></center></pre></bdo></b><th id='5uwGZ'></th></span></q></dt></tr></i><div id='5uwGZ'><tfoot id='5uwGZ'></tfoot><dl id='5uwGZ'><fieldset id='5uwGZ'></fieldset></dl></div>
        <bdo id='5uwGZ'></bdo><ul id='5uwGZ'></ul>
    3. 在棒棒糖版本上方的通知中设置小图标

      Setting small icon in Notification above lollipop version(在棒棒糖版本上方的通知中设置小图标)
    4. <i id='fLrLg'><tr id='fLrLg'><dt id='fLrLg'><q id='fLrLg'><span id='fLrLg'><b id='fLrLg'><form id='fLrLg'><ins id='fLrLg'></ins><ul id='fLrLg'></ul><sub id='fLrLg'></sub></form><legend id='fLrLg'></legend><bdo id='fLrLg'><pre id='fLrLg'><center id='fLrLg'></center></pre></bdo></b><th id='fLrLg'></th></span></q></dt></tr></i><div id='fLrLg'><tfoot id='fLrLg'></tfoot><dl id='fLrLg'><fieldset id='fLrLg'></fieldset></dl></div>

            <bdo id='fLrLg'></bdo><ul id='fLrLg'></ul>

            <small id='fLrLg'></small><noframes id='fLrLg'>

            <legend id='fLrLg'><style id='fLrLg'><dir id='fLrLg'><q id='fLrLg'></q></dir></style></legend>
            • <tfoot id='fLrLg'></tfoot>
                  <tbody id='fLrLg'></tbody>
                本文介绍了在棒棒糖版本上方的通知中设置小图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我已经创建了提醒通知.如下图,

                I have created heads up notification. As like below,

                NotificationCompat.Builder notification = new NotificationCompat.Builder(this, channelId)
                                .setContentTitle("Message")
                                .setContentText("Recieved Successfully")
                                .setContentIntent(pendingIntent)
                                //.setColor(ContextCompat.getColor(this, R.color.green))
                                .setSmallIcon(R.drawable.notification_icon)
                                .setDefaults(Notification.DEFAULT_ALL)
                                .setContentIntent(pendingIntent)
                   .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
                                .setAutoCancel(true)
                                .setPriority(NotificationCompat.PRIORITY_HIGH);
                        manager.notify(m,notification.build());
                

                上面的代码放置在一个名为 NotificationService 的类中,该类扩展了 Service.

                Above code placed inside a class named NotificationService which extends Service.

                我可以使用下面的代码设置颜色,

                I can able to set color using below code,

                setColor(ContextCompat.getColor(this, R.color.colorAccent))
                

                但使用它只能设置唯一的颜色.

                But using that able to set only a unique color.

                **我的目标不是那个.我想将我的图标设置为其原始颜色,就像在 Dominos 中一样.

                **My goal is not that.I want to set my icon with its original color as like in Dominos.

                在 Android Manifest 中添加以下代码,

                Added below code in Android Manifest,

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

                当我收到推送通知时,我正在启动我的服务以显示如下通知,startService(new Intent(this,NotificationService.class));

                When I am getting push notification I am starting my Service for displaying notification like below, startService(new Intent(this,NotificationService.class));

                但我收到灰色通知图标,而不是原始颜色.还搜索了很多网站和堆栈问题.但是关于这个问题的问题的答案是我上面提到的在 Android Manifest 中放置通知图标的代码.尽管我遵循了答案,但无法将通知图标设置为多米诺骨牌.我没能找到哪里出错了.搜索了大多数发布的堆栈问题.但无法为我的问题找到合适的答案.

                But Im getting notification icon with grey color, not in original color. Also searched a lot sites and stack question. But the answer for the question regarding this problem is the code for placing notification icon in Android Manifest which I mentioned above. Eventhough I followed the answers, couldn't set the notification icon as like dominos. I didnt able to find where it is going wrong. Searched most of the stack questions posted. But not able to find suitable answer for my problem.

                请大家帮帮我...

                以下是我收到的通知.

                如您所见,我的通知图标由两个文本组成.而这两个包含两种不同的颜色.这就是我想要达到的目标.但我只得到灰色.设置颜色将为 h 和 m 设置一种唯一的颜色.我不想那样.

                As you can see my notification icon consist of two text. And those two contains two different color. Thats what I am trying to achieve. But I am getting only grey color. Setting color will set only one unique color for both h and m. I dont want that.

                没有解决办法??没有人做到这一点??

                There is no solution for this?? No one achieved this??

                推荐答案

                在新的 Android SDK 中,我认为所有图标都变成了纯色.

                In the new Android SDKs I think all icons are turned into a plain color.

                查看这个问题,该问题提供了 Lollipop 通知颜色的一些解决方案.

                Look into this question that provides some solutions in notification colors in Lollipop.

                通知栏图标在 Android 5 Lollipop 中变为白色

                这篇关于在棒棒糖版本上方的通知中设置小图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                When does a FCM token expire?(FCM 令牌何时到期?)
                Firebase Cloud Messaging (FCM) - Launch Activity when user clicks the notification with extras(Firebase Cloud Messaging (FCM) - 当用户点击带有附加功能的通知时启动活动)
                Implement Firebase inside of a Library(在库中实现 Firebase)
                Firebase Backward compatibility with GCM(Firebase 与 GCM 的向后兼容性)
                Receiving the FCM notifications multiple times on Nougat(在 Nougat 上多次接收 FCM 通知)
                Push Notifications are delivered but didReceiveRemoteNotification is never called Swift(推送通知已交付,但 didReceiveRemoteNotification 从未被称为 Swift)

                      • <bdo id='csfuS'></bdo><ul id='csfuS'></ul>
                          <tbody id='csfuS'></tbody>

                      • <tfoot id='csfuS'></tfoot>
                      • <i id='csfuS'><tr id='csfuS'><dt id='csfuS'><q id='csfuS'><span id='csfuS'><b id='csfuS'><form id='csfuS'><ins id='csfuS'></ins><ul id='csfuS'></ul><sub id='csfuS'></sub></form><legend id='csfuS'></legend><bdo id='csfuS'><pre id='csfuS'><center id='csfuS'></center></pre></bdo></b><th id='csfuS'></th></span></q></dt></tr></i><div id='csfuS'><tfoot id='csfuS'></tfoot><dl id='csfuS'><fieldset id='csfuS'></fieldset></dl></div>
                        <legend id='csfuS'><style id='csfuS'><dir id='csfuS'><q id='csfuS'></q></dir></style></legend>
                        1. <small id='csfuS'></small><noframes id='csfuS'>