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);
Here is what the above code is Doing:
1. Find the view by its ID.
2. Set the visibility of the view to either INVISIBLE, GONE, or VISIBLE.