sample/src/main/java/com/urbanairship/sample/MainActivity.java
private void updateUnreadCount() {
        int unreadCount = UAirship.shared().getInbox().getUnreadCount();
        TextView view = (TextView) navigation.getMenu().findItem(R.id.nav_message_center).getActionView();

        if (unreadCount > 0) {
            view.setVisibility(View.VISIBLE);
            view.setText(String.valueOf(unreadCount));
        } else {
            view.setVisibility(View.GONE);
        }
    }
/**
     * Updates the unread count for the message center in the nav bar.
     */
Updates the unread count for the message center in the nav bar.
Updates the unread count for the message center in the nav bar .
private void updateUnreadCount() {
        int unreadCount = UAirship.shared().getInbox().getUnreadCount();
        TextView view = (TextView) navigation.getMenu().findItem(R.id.nav_message_center).getActionView();
        if (unreadCount > 0) {
            view.setVisibility(View.VISIBLE);
            view.setText(String.valueOf(unreadCount));
        } else {
            view.setVisibility(View.GONE);
        }
    }
private void updateUnreadCount ( ) { int unreadCount = UAirship . shared ( ) . getInbox ( ) . getUnreadCount ( ) ; TextView view = ( TextView ) navigation . getMenu ( ) . findItem ( R . id . nav_message_center ) . getActionView ( ) ; if ( unreadCount > 0 ) { view . setVisibility ( View . VISIBLE ) ; view . setText ( String . valueOf ( unreadCount ) ) ; } else { view . setVisibility ( View . GONE ) ; } }
Updates the unread count for the message center in the nav bar.
Updates the unread count for the message center in the nav bar .