set View Visiblity Otherwise Gone - Android User Interface

Android examples for User Interface:View Property

Description

set View Visiblity Otherwise Gone

Demo Code


//package com.java2s;
import android.view.View;

public class Main {
    public static boolean setVisiblityOtherwiseGone(boolean vVisible,
            View vView) {//  w w w .ja v  a2  s.c  o  m
        int picVisibility;
        if (vVisible == true) {
            picVisibility = View.VISIBLE;
        } else {
            picVisibility = View.GONE;
        }
        vView.setVisibility(picVisibility);
        return vVisible;
    }
}

Related Tutorials