you can do like this way.
yourbutton.setVisibility(Button.GONE);
This will be remove your button from your layout so other control will be used that space.
If you want to just hide and keep button size with another layout you can use
yourbutton.setVisibility(Button.INVISIBLE);