tags:

views:

14

answers:

0

Hi there,

I have a ListView that shows the closest word matches to a search.

For example if I search "hi" I get the following results in the ListView


...
hi
hi five
hi-five
high
highlight
....

I am using

ListView.setSelection(wordList.indexOf(searchWord));
ListView.setSelected(true);

The above code puts the selected word "hi" at the top and doesnt highlight the selection.

I want the "hi" to be centrally positioned , selected and highlighted automatically. See below

...
hello
hello there
hi
hi-five
hi five
...

What code can I use to achieve the above?

Many thanks.