I have a button that I want its text appear for 1 second then disappear for 1 second, loop for 6 seconds, here is what I tried:
for(int i = 0 ; i < 6 ; i++) {
button.setTextSize(18);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
button.setTextSize(0);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
first is it appear that the button's text size became 36 instead of 18,
second is it is does not act as I expected, never show the text,
note: the text size from start is 0.
How can I achieve this?