Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.Handler;

import android.view.View;

public class Main {
    public static void lockForOneSec(final View view) {
        if (!view.isClickable())
            return;
        view.setClickable(false);
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                if (view == null)
                    return;
                view.setClickable(true);
            }
        }, 1000);
    }
}