set All Widgets to Clickable - Android android.view

Android examples for android.view:View

Description

set All Widgets to Clickable

Demo Code

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);
                }/* w  ww .jav a 2 s . c  o m*/
            }
        };
        act.runOnUiThread(runnable);
    }

}

Related Tutorials