I have this code:
result.setVisibility(0);
//a lot of code
//OnClick......
result.setVisibility(8);
SystemClock.sleep(500);
result.setVisibility(0);
So when i click a button the textView disappears and reappears to show that the result is changed.
But instead the textView “result” don’t disappear and remains always visible. Why ?
I am not sure if the
setVisibilityfunction is at fault here. It appears that you are trying to sleep inside the UI code which happens to be a very commonplace mistake.I am not sure but this willl help you.
Also I would recommend the usage of the pre defined constants
VISIBLE,INVISIBLEandGONEinstead of the integers.Good Luck