-2

I would like to set an attribute to large amount of TextViews (above 30).

For instance - Initialize all of them and right after set attribute to insviaiable.

tv_something = findViewById(R.id.tv_something);
tv_something.setVisibility(TextView.INVISIBLE);

And after a button press (SetOnClickListner..) change the attribute to visible

tv_something.setVisibility(TextView.VISIBLE);

What's the most efficient way to do that?

shir k
  • 107
  • 6

1 Answers1

1

I don't know the use case for this but you can make Custom Views it'll help you set common behavior for any number of views.

Sayed El-Abady
  • 247
  • 2
  • 12