[Solved] how to disable a button’s onClick() event for some time?


Try this code..

 mbtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    mbtn.setEnabled(true);
                }
            },2000);
            mbtn.setEnabled(false);
        }
    });

4

solved how to disable a button’s onClick() event for some time?