Skip to content Skip to sidebar Skip to footer

Android Correct Way If Implementing Filterable In Auto-complete

What i am trying to do is and failing miserably is this: In my view I have an auto-complete Textview. I would like to fetch via a GET a json array of objects. Takes about 1-2 secs.

Solution 1:

This is very late, but I believe that's the expected behavior. The filtering logic will queue the requests while another request is outgoing. So if you type "a" it will go fetch the results and any letter(s) after that will be waiting until the results for "a" come back. After those results come back, a new request will go out, and so on.

Solution 2:

salam I found the solution here is the code that you must make

if(constraint!=null) {
                if(orig!=null&&orig.size()>0) {
                    for(finalstation g :orig) {
                        if(g.getName().toLowerCase().contains(constraint.toString()))results.add(g);
                    }
                }
                oReturn.values=results;
            }

Post a Comment for "Android Correct Way If Implementing Filterable In Auto-complete"