Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Single onClick method to handle text and button click Android

 
Archie sudhir
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can any one tell ... Single onClick method to handle text and button click in Android


eg:

TextView txt1;
Button b1:

b1.setOnClickListener(this);
txt1.setOnclickListener(this);

public void onClick(View v1) {

/*What to write to diff between the two onclick events*/
}
 
asha Pawaskar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey try with this


// do something
break;

}
}


[/code]


 
Archie sudhir
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Thank you .....

Its working .....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic