Android Hide and Show buttons from a condition Your button is in the XML layout, so you can hide it or show it by just changing its visibility NB: You only need do these operations once: Get a reference to your button, with findViewById() Set the OnClickListener of