android - Getting text from a button -
if use multiple ids same @click event method like
@viewbyid button choice1; @viewbyid button choice2; @click({r.id.choice1,r.id.choice2}) void choice(){ //string text = text of clicked button } how text of button being clicked?
as wrote on wiki can add view parameter in method signature, :
@click({r.id.choice1, r.id.choice2}) void choice(view clickedview) { [...] } also don't have annotate buttons viewbyid in order use click (unless need reference these instances, of course)
Comments
Post a Comment