开发者

how to show the list of item in related to search word in Android

i want to show the list of item which contain search alphabets (alphabets in Search(EditText))

Example: 1) [a] -----> i enter Alphabet "a" in search(Edit Text) and i want to show the list of item related to that alphabet as shown in below

result : *a*ton b*a*toon r*a*o Rob*开发者_运维百科a*t

2) [at]---> i add "t" in EditText i want to show the result related to "at" as show in below (in list) likt this result : at*on b*at*oon Rob*at

i have list of parsed item and i want to search and show the item (When in enter text in Edit text i want to show the result related to that particular world )...


This would be my suggestion, then you just need to overwrite your toString with the right value.

protected ArrayList<Object> searchItems(String cs){
        ArrayList<Object> resultList = new ArrayList<Object>();
        for(Object e:mDataList){
            if(e.toString().contains(cs)){
                resultList.add(e);
            }
        }
        return resultList;
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜