但似乎没有任何效果.有什么想法吗? 解决方案 在 Android Lollipop 5.0 或更高版本下,您必须使用透明的白色图标.您可以扩展 ParsePushBroadcastReceiver 类并覆盖这两个方法,以使您的通知图标与这些 Android API 兼容. @Override受保护的 int getSmallIconId(上下文上下文,意图意图){返回 R.drawable.your_notifiation_icon;}@覆盖受保护的位图 getLargeIcon(上下文上下文,意图意图){返回 BitmapFactory.decodeResource(context.getResources(), R.drawable.your_notifiation_icon);}记得自定义您的代码以支持 Lollipop 和以前的 API. if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {返回 BitmapFactory.decodeResource(context.getResources(), R.drawable.your_notifiation_icon_lollipop);}别的{返回 BitmapFactory.decodeResource(context.getResources(), R.drawable.your_notifiation_icon);}When using Parse for push notifications our app always displayed the application's launcher icon.In the latest Android 5.1 version, the icon appears to be blank (a white square).I tried setting the icon in the meta data:<meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/noti_icon"/>Based on the question hereBut nothing seems to work.Any ideas? 解决方案 You must use a transparent and white icon under Android Lollipop 5.0 or greater. You can extend ParsePushBroadcastReceiver class and override the two methods to get your notification icon compatible with these Android APIs. @Overrideprotected int getSmallIconId(Context context, Intent intent) { return R.drawable.your_notifiation_icon;}@Overrideprotected Bitmap getLargeIcon(Context context, Intent intent) { return BitmapFactory.decodeResource(context.getResources(), R.drawable.your_notifiation_icon);}Remember to customize your code to support Lollipop and previous APIs. if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { return BitmapFactory.decodeResource(context.getResources(), R.drawable.your_notifiation_icon_lollipop); } else{ return BitmapFactory.decodeResource(context.getResources(), R.drawable.your_notifiation_icon); } 这篇关于Android 5.1 推送通知图标为空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-02 14:06