java - How to create GUI in Android instead of using XML? -
i don't manage xml
, java
together, can create same gui using java
language? how can that, can tell me code simple button
? appreciate proper answer.
yes, can.
public class myactivity extends activity { protected void oncreate(bundle icicle) { super.oncreate(icicle); final button button = new button(this); button.settext("press me!"); setcontentview(button); button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { // perform action on click } }); } }
Comments
Post a Comment