I want to give the sensation that a button was pressed by the system. The two images are used when the user presses the button and I want to create the same effect using a thread sleeping between the display of both images.
But the system doesn't update the button src as expected. Resuming I want to change the src, wait 600 ms and update again. Can someone give me a direction on it?
switch (color) {
case 1: //green
// first image
Main.imageButtonGreen.setImageResource(R.drawable.light_green);
//this is just to make it sleep to give the sensation that the button was pressed
try {
Blink blink = new Blink();
Thread t = new Thread(blink);
t.run();
t=null;
}
catch (Exception e){if (Main.debug) Log.d("Blink.blink Switch color= ", e.getMessage());}
//scond image
Main.imageButtonGreen.setImageResource(R.drawable.dark_green);
break;
}