set visibility android studio code example
Example 1: android studio visibility
//An ImageButton for example:
ImageButton btn = findViewById(R.id.viewID);
btn.setVisibility(View.INVISIBLE); // or...
btn.setVisibility(View.GONE); // or...
btn.setVisibility(View.VISIBLE);
Example 2: change visibility of textview andoird
textView.setVisibility(TextView.INVISIBLE);
textView.setVisibility(TextView.VISIBLE);