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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -