Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MuthuEphron opened this issue Jan 11, 2017 · 1 comment
Milestone

Comments

@MuthuEphron
Copy link

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();

@athkalia
Copy link
Owner

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 athkalia added this to the v0.5.0 milestone Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants