set All Widgets Clickable - Android User Interface

Android examples for User Interface:View Enable

Description

set All Widgets Clickable

Demo Code


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

public class Main {
    public static void setAllClickable(final int[] btns,
            final Activity act, final boolean clickable) {
        Runnable runnable = new Runnable() {
            public void run() {
                for (int val : btns) {
                    act.findViewById(val).setClickable(clickable);
                }/*from  w  w  w . j  a  v a 2  s .c om*/
            }
        };
        act.runOnUiThread(runnable);
    }
}

Related Tutorials