Code example for ListView

Methods: getContext, getResources

0
    private boolean showNumber() { 
        return type != HomeListWrapperType.TYPE_STARRED;
    } 
 
    public void updateGlobalUnreadCount(final int unreadCount) {
        adapter.updateItem(new ListItemSubTag("", view.getContext().getString(getFirstItemTitleResId()),
                showNumber() ? unreadCount : 0, view.getResources(), getDefaultIconResId()));
    } 
 
    @Override 
    public void onSubscriptionUpdated(final Subscription sub) {
        int loc = adapter.getCount();
        boolean erased = false, updated = false;
        if (hideZeroItems() && sub.getUnreadCount() <= 0) {
            final Integer itemLoc = adapter.getItemLocationById(sub.getUid());
            if (itemLoc != null) {
                adapter.removeItem(itemLoc);
                subscriptionCount--;
                erased = true;
            } 
            loc--;