I set up quite a few TextViews in a for loop, and each one gets .setClickable(true)
Then, I
tv.setOnClickListener(new OnClickListener() { //tv is the TextView.
public void onClick(View v) {
}
});
I know that it’s a TextView, but I’m given View v. How do I get the text of the TextView from inside public void onClick(View v){ }? Remember: I can’t simply make tv a final because it’s in a for loop and it makes a lot of TextViews.
Can you typecast as below?