I\'m using two button in view. While clicking two button simultaneously it will goes to different activity at a time. How to avoid this?
I have tried like this, But
first :
public class ClickValidate {
public static long lastClickTime;
public static boolean isValid()
{
long current=System.currentTimeMillis();
long def = current - lastClickTime;
if (def>1000)
{
lastClickTime = System.currentTimeMillis();
return true;
}
else
return false;
}
}
Now just call this method everywhere in the body of onCLick method Or wherever you need:
if (ClickValidate.isValid()){
//your code
}