java - How to construct a button on runtime (Android) -


there's nothing on particular feature of android in documentation (for example here:

http://developer.android.com/reference/android/widget/button.html#button(android.content.context)

how add button exsiting layout (or create layout on runtime well)?

and then, how apply attributes said button i've created?

you can create button code. can find alternative methods of setting attribute in doc. example

          button button = new button(this);            button.settext("hi");            button.setid(id);           button.settextcolor(color.red);           button.setbackgroundresource(r.drawable.icon);           buttonlayout.addview(button);  

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -