Java tutorial
//package com.java2s; import android.view.View; public class Main { public static void setNdHide(View view, Object isHide) { if (!(isHide instanceof Boolean)) { throw new IllegalArgumentException("isHide must be boolean in setNdHide(isHide)!"); } if ((Boolean) isHide) { view.setVisibility(View.GONE); } else { view.setVisibility(View.VISIBLE); } } }