mikepenz/Android-ActionItemBadge

com.mikepenz:actionitembadge:3.1.1 null pointer

Closed this issue · 1 comments

        Drawable drawable = UIUtil.getCompatDrawable(ScreenActivity.this, R.drawable.icon_sort_white);
        if (drawable == null) {
            Logger.d("null");
            return true;
        }
        ActionItemBadge.update(this, mi_buy, drawable, ActionItemBadge.BadgeStyles.RED, 1);
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setBackground(android.graphics.drawable.Drawable)' on a null object reference
            at com.mikepenz.actionitembadge.library.utils.UIUtil.setBackground(UIUtil.java:28)
            at com.mikepenz.actionitembadge.library.ActionItemBadge.update(ActionItemBadge.java:200)
            at com.mikepenz.actionitembadge.library.ActionItemBadge.update(ActionItemBadge.java:105)

sorry i have same name menu_badge in my layout ..
i solve this question