You are using android views in the wrong way.
Views have three properties to alter visibility which are
- Visible: By default, all views are visible
- Invisible: The
view
is not visible but occupies space and resources
- Gone: The
view
is entirely out of the layout
Visisble
is used to set a view
from either of the other two.
Invisible
is used when you want a certain button
that is lying on top of another view
to be clicked rather than the view. It can also be used when you want a view
to occupy space but not be present for the user. This scenario might occur when using LinearLayouts
with android:layoutWeight
Gone
is used when you want to completely hide a view from the picture. This is common with login screens and welcome previews in apps