how can onclicklisteners out of oncreate? i´m new android programming , have this:
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); startbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { pname = edtext.gettext().tostring(); regstat = true; setcontentview(r.layout.activity_studioreg); } }); } but how can them in new method , have use them correctly ?
you can use butterknife api, code cleaner like:
@onclick(r.id.start_button) public void onstartbuttontouched() { // todo }
Comments
Post a Comment