Thursday, February 21, 2019

Neutralize TextView, Button Android

We want button can’t click, add this line to below findViewByid.
button.setEnabled(false);
To make it clickable again, change to.
button.setEnabled(true);
To hide button or textview, add this line.
TextView.setVisibility(View.INVISIBLE);
To show it again.
TextView.setVisibility(View.VISIBLE);
To complete remove view.

TextView.setVisibility(View.GONE);

No comments:

Post a Comment