public static void setTextOrHide ( final TextView view , final CharSequence text , final int hvisibility ) { if ( TextUtils . isEmpty ( text ) ) { view . setVisibility ( hvisibility ) ; } else { view . setText ( text ) ; view . setVisibility ( View . VISIBLE ) ; } }
Set text view value or change its visibility in case of empty value .