Stelios M
Stelios M

Reputation: 237

How to disable a TextView

Is there any command i can use in activity class that disables TextViews that are created in xml file? I want to put that in an if clause like:

 if (something == null) {
     TextView.dontCreate();
 } else {
     TextView.setText("Hello");
 }

Upvotes: 2

Views: 8757

Answers (1)

Joe
Joe

Reputation: 36

In the reference I find two methods:invalidate() and setVisibility() .But it's an english preference so with a broken english I couldn't distinguish them exactly.Maybe, you could have a try.

Upvotes: 2

Related Questions