android - Prevent multiple button clic -


how can prevent user clic 2 button on same time.

     boolean processclick = true;          @override             public void onclick(view v) {                  if (!processclick) return;                  switch (v.getid()) {                  case r.id.btn:                      if (processclick) {                   //some action                  processclick = false;        }    }     } 

this works fine when action launch new activity it's wrong when show toast message.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -