• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps is there any way to put EditText on button

goldE

Lurker
hi

i have 2 button's on my screen, i need that when i press button2

the EditText will appear on the button1 and when i'll press button2

again, the EditText will disappear.

is there any way to do it on java for android ?



thanks in advance
 
Now that I think about it. The best ting to do would be to subclass EditText and implement the OnClickListener Interface.
 
what about having the button and the edittext on the same position , and when one button is clicked , the other edittext would go into "gone" status and the button would show
I don't see how this may not work
 
Well, in this case, that would work I suppose, but it's really not the best method of doing things. There are only a handful of scenarios where "hiding" a control is considered good practice. This is what the enabled state is there for.
 
Back
Top Bottom