hide Views With Id - Android User Interface

Android examples for User Interface:View Hide Show

Description

hide Views With Id

Demo Code


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

public class Main {
    public static void hideViewsWithId(Activity activity, int... ids) {
        updatedViews(activity, View.GONE, ids);
    }//from  w w w. java2s.  c  o m

    private static void updatedViews(Activity activity, int visibility,
            int... ids) {
        for (int id : ids) {
            View view = activity.findViewById(id);
            if (view != null) {
                view.setVisibility(visibility);
            }
        }
    }
}

Related Tutorials