Home  >  Forum  >  Android
Post New Query

Android hide show button programmatically



Asked on August 13, 2015
How to hide and show button programmatically in android? 



Replied on August 13, 2015
Button, EditText, TextView, ListView etc are the classes in android and there is a method

setVisibility()

In which we can pass

View.GONE
View.VISIBLE
View.INVISIBLE


as required. See the samples.

1.  button.setVisibility(View.GONE)  will hide the button and space acquired by button
2.  button.setVisibility(View.INVISIBLE) will hide button only.
3.  button.setVisibility(View.VISIBLE) will make button visible.




Write Answer




©2019 concretepage.com | Privacy Policy | Contact Us