0

I have 6 TextViews in which I declared clickable. all TextViews access the same onClick method.

How can I get the foreground and background colors of the clicked TextView ?

S.L.
  • 69
  • 10

1 Answers1

0

Straight forward without caring about anything.

public void onClick(View v) {
       if (v instanceof TextView)
        int colorOfSelectedTextView = ((TextView) v).getCurrentTextColor();
    }
Murat Karagöz
  • 35,401
  • 16
  • 78
  • 107