show Views With Id - Android User Interface

Android examples for User Interface:View Hide Show

Description

show Views With Id

Demo Code


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

public class Main {
    public static void showViewsWithId(Activity activity, int... ids) {
        updatedViews(activity, View.VISIBLE, ids);
    }//from  w  ww.ja  v  a2 s  . co  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