user2054763
user2054763

Reputation: 25

how to disappear button in android

I am working on an interface where user searches for a specific item from database. I have one EditText and button in my xml file. So i want to disappear the botton and EditText temporarily , after clicking the buuton , so that user can view the required details.. How can I implement this within same activity?

Upvotes: 2

Views: 5301

Answers (3)

MysticMagicϡ
MysticMagicϡ

Reputation: 28823

edittxt.setVisibility (View.INVISIBLE);
btn.setVisibility (View.INVISIBLE);

or

edittxt.setVisibility (View.GONE);
btn.setVisibility (View.GONE);

View.INVISIBLE means, the views will still take space on screen. Whereas, View.GONE means they will not take space on the screen. More info if you want.

Upvotes: 3

Yogesh Tatwal
Yogesh Tatwal

Reputation: 2751

Try this

button.setVisibility(View.GONE);

when you want to visible than

button.setVisibility(View.VISIBLE);

Upvotes: 2

rajeshwaran
rajeshwaran

Reputation: 1500

Disappear means invisible,

edittext.setVisibility(View.INVISIBLE);

you can visible the editext,

edittext.setVisibility(View.VISIBLE);

Upvotes: 0

Related Questions