I have implemented AutoCompleteTextView
for the search field in my application.
I want to highlight the text entered in the AutoCompleteTextView
(the search text field) to be highlighted in the drop down list. How can I do this?.
So, In your getView
method add the following
Spannable spanText = Spannable.Factory.getInstance().newSpannable(textString);
spanText.setSpan(new BackgroundColorSpan(0xFFFFFF00), startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
myTv.setText(spanText);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With