view - How to retrieve object's text onClickListener? -
how retrieve text view object?
example, have button has text , onclick
of button. want retrieve text in onclicklistener
method..
use this:-
button button= new button(context); button.settext(r.string.uploadimage); button.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub button b = (button) v; string buttontext = b.gettext().tostring(); toast.maketext(context, buttontext, toast.length_short).show(); } });
Comments
Post a Comment