How to pause / sleep thread or process in Android?
One solution to this problem is to use the Handler.postDelayed() method. Some Google training materials suggest the same solution. @Override public void onClick(View v) { my_button.setBackgroundResource(R.drawable.icon); Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { my_button.setBackgroundResource(R.drawable.defaultcard); } }, 2000); } However, some have pointed out that the solution above causes a … Read more