I\'m building a login style application within android studio. As part of this I have created a rule that if the counter which monitors the number of invalid login attempts, get
Use following code. it will disabled button after 5 seconds when activity or fragment start when you put in OnCreate() method.
new Handler().postDelayed(new Runnable() { public void run() { b1.setEnabled(false); } }, 5000 //Specific time in milliseconds );