android - Changing layout through user input -
im new app development.
i want add button on screen when clicked give user textedit in can enter data. can give brief description how done?
i'm not going write code scratch can give few pointers should help. can create new edittext
like
public void onclick(view v) { edittext et = new edittext(v.getcontext()); // add layout params, text, etc... }
then need add viewgroup
such linearlayout
in inflated layout
viewgroupname.addview(et)
;
however, simpler way, if works you, have edittext
defined in xml , set visibility
either invisible
or gone
set visibility
in onclick()
visible
.
hopefully enough started. if have questions feel free ask.
Comments
Post a Comment