vendredi 22 janvier 2016

Android Filter class performFiltering method

In my android application i integrated custom Filter class to filter data that comes from server.

Here is some explanations,

private class ArrayFilter extends Filter {
    Filter.FilterResults results = new Filter.FilterResults();

    @Override
    protected FilterResults performFiltering(CharSequence prefix) {

       ....
        // Here i need to call web service and need to fetch data from server.
        // I need to return this method when i get response from server only
        // So logically i do not need to call this return results method until server respond
       ......

        return results;
    }

    @SuppressWarnings("unchecked")
    @Override
    protected void publishResults(CharSequence constraint, FilterResults results) {
            ........
            ........


    }
}

- How should i able to return that method only when i get response from server?




Aucun commentaire:

Enregistrer un commentaire