I want to hide TextView after some time interval say 3 seconds. I googled and found some code and I tried code as shown below but It is not working.
Please tell me what is the wrong with this ?
tvRQPoint.setText("+0");
tvRQPoint.postDelayed(new Runnable() {
public void run() {
tvRQPoint.setText("+0");
}
}, 3000);
One more thing, how to remove timeout ? As I am using this on click
event of ListView
, If user clicks on one option and then clicks on second option, then as 3 seconds got over (after clicked on first option), It does not show second option for 3 seconds.
try this...
Try this-
You are setting the text in run() method. you can hide the text in two ways
View.INVISIBLE
- give the space for the textview and hide its contentView.GONE
- remove the space for textview and hide its contentso call
try
View INVISIBLE
orGONE
like:Set
View visibility
with view.setVisibility(View.INVISIBLE|View.VISIBLE|View.GONE);How about hiding your text view with some animation?
hope it's work: