java - Android, How can I get text from TextView in OnClick -


i have textview , each have onclicklistener. information in method textview

textview tv2 = new textview(this,(string)book.get(i),this); tv2.setonclicklistener(new onclicklistener() {      public void onclick(view v) {         intent intent = new intent(contact.this,discution.class);         //string str = this.gettext(); //like         startactivity(intent);     } }); 

how can : this.gettext(); in onclicklistener ?

tv2.setonclicklistener(new onclicklistener() {  public void onclick(view v) {     intent intent = new intent(contact.this,discution.class);              string str = tv2.gettext().tostring();               startactivity(intent); } 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -