I have two array one is words another is sentences. Now, i want to underline this common word. for examples first word is "at" and first sentences is "dont at work". so I want to to display both word and sentence but in sentence was must be underline. how to make this.
You have just to find the word's first and last word place in whole sentence String
, then use this code to underline that something like:
SpannableString content = new SpannableString("joe was a sick");
content.setSpan(new UnderlineSpan(), 4, 6, spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
label.setText(content);
NOTE: in this example 4 and 6 are hard coded, You can find start and end points by using some looping and comparing methods upon sentence String