EmphasisTextView icon indicating copy to clipboard operation
EmphasisTextView copied to clipboard

java.lang.IllegalStateException: You must specify a color to highlight the text with before using executing the highlight operation.

Open MuthuEphron opened this issue 9 years ago • 1 comments

I am using emphasisTextView. i use your classes and methods. but i got

java.lang.IllegalStateException: You must specify a color to highlight the text with before using executing the highlight operation. mTextEmphasis.setText(aResult); mTextEmphasis.setTextToHighlight(mSearch); mTextEmphasis.setHighlightColor(Color.GREEN); mTextEmphasis.setCaseInsensitive(true); mTextEmphasis.highlight();

MuthuEphron avatar Jan 11 '17 13:01 MuthuEphron

Hey there. That's because the setHighlightColor takes an android color resource, not a color from the Color class. On the next version of the library I will add support for that. In the meantime you can use one of the following two:

setTextHighlightColor("#0000FF00"); or setTextHighlightColor(android.R.color.holo_green_dark);

athkalia avatar Jan 11 '17 18:01 athkalia