GCMInternet service.java mBuilder在java中设置颜色错误

GCMInternet service.java mBuilder在java中设置颜色错误,java,Java,此行->mBuilder.setColor(iconColor) 对于类型NotificationCompat.Builder mBuilder 这是我的密码 private void setNotificationIconColor(String color, NotificationCompat.Builder mBuilder, String localIconColor) { int iconColor = 0; if (color != null) {`enter co

此行->
mBuilder.setColor(iconColor)

对于类型
NotificationCompat.Builder mBuilder

这是我的密码

private void setNotificationIconColor(String color, NotificationCompat.Builder mBuilder, String localIconColor)
{
    int iconColor = 0;
    if (color != null) {`enter code here`
        try {
            iconColor = Color.parseColor(color);
        } catch (IllegalArgumentException e) {
            Log.e(LOG_TAG, "couldn't parse color from android options");
        }
    }
    else if (localIconColor != null) {
        try {
            iconColor = Color.parseColor(localIconColor);
        } catch (IllegalArgumentException e) {
            Log.e(LOG_TAG, "couldn't parse color from android options");
        }
    }
    if (iconColor != 0) {
        mBuilder.setColor(iconColor);
    }
}

如果您将其用作Phonegap/Cordova项目的推送通知,只需执行以下步骤,在模拟之前更新代码:

private void setNotificationIconColor(String color, NotificationCompat.Builder mBuilder, String localIconColor)
{
    int iconColor = 0;
    if (color != null) {`enter code here`
        try {
            iconColor = Color.parseColor(color);
        } catch (IllegalArgumentException e) {
            Log.e(LOG_TAG, "couldn't parse color from android options");
        }
    }
    else if (localIconColor != null) {
        try {
            iconColor = Color.parseColor(localIconColor);
        } catch (IllegalArgumentException e) {
            Log.e(LOG_TAG, "couldn't parse color from android options");
        }
    }
    if (iconColor != 0) {
        //mBuilder.setColor(iconColor);
    }
}