Android : Skipping to Listview position given input char or string
Can someone tell me how to skip to a position in an alphabetically sorted ListView when given a char or string input from an onClick method?
开发者_如何学编程For example, I have a dialog that passes back a char. If that char is a B I want the listview to skip to the first B entry.
Any help would be greatly appreciated.
Thanks, Josh
If your listview contains so many entries that this is necessary, wouldn't it be beneficial to simply remove all but the "b" entries? Thus your listview would automatically show the "b's" and only the "b's." It should be pretty easy to do that if you dump the entries into a list or array object.
I realize this doesn't directly answer your question, but sometimes it can be beneficial to get outside feedback on a design aspect.
Also, doesn't
myListview.Items(X).Selected = true;
where X is your first "b" item solve the problem?
精彩评论