I am using `SearchView` in `RecyclerView` to search the items. When I am typing something in `SearchView` the filter results are not displayed and the app get exited. It doesn't provide any logs. I am confused where to use `notifyDataSetChanged` method.  

This is the code for Adapter class.

```
public class NewAdapter extends RecyclerView.Adapter<NewAdapter.ViewHolder> implements Filterable{

    private ArrayList<CurrentEntry> listItems;
   private ArrayList<CurrentEntry> filterList;
   Context context;

    public NewAdapter(ArrayList<CurrentEntry> listItemss, Context context) {
      //  this.listItems = listItems;
       this.listItems=listItemss;
       this.filterList=listItems;
        this.context = context;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v= LayoutInflater.from(parent.getContext())
                .inflate(R.layout.list_card,parent,false);
        return new ViewHolder(v);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
          /* CurrentEntry current=listItems.get(position);
           holder.number.setText(current.getNo());
           holder.Name.setText(current.getName());
           holder.People.setText(current.getPeople());
           holder.Estimate.setText(current.getEstimate());
           holder.Foodie.setText(current.getFoodie());*/
          holder.number.setText(filterList.get(position).getNo());
          holder.Name.setText(filterList.get(position).getName());
          holder.People.setText(filterList.get(position).getPeople());
          holder.Estimate.setText(filterList.get(position).getEstimate());
          holder.Foodie.setText(filterList.get(position).getFoodie());
    }

    @Override
    public int getItemCount() {
        return listItems.size();
    }

    @Override
    public Filter getFilter() {
        return new Filter() {
            @Override
            protected FilterResults performFiltering(CharSequence constraint) {
                String charString=constraint.toString();
                if(charString.isEmpty())
                {
                    filterList=listItems;
                }
                else
                {
                    ArrayList<CurrentEntry> myList=new ArrayList<>();
                    for(CurrentEntry temp:listItems)
                    {
                        if(temp.getName().toLowerCase().contains(charString));
                        filterList.add(temp);
                    }
                    filterList=myList;
                }
                    FilterResults filterResults=new FilterResults();
                filterResults.values=filterList;
                return filterResults;
            }

            @Override
            protected void publishResults(CharSequence constraint, FilterResults results) {
                             filterList=(ArrayList<CurrentEntry>) results.values;
                          notifyDataSetChanged();
            }
        };
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        TextView number;
        TextView Name ;
        TextView People;
        TextView Estimate;
        TextView Foodie;
        public ViewHolder(View itemView) {
            super(itemView);

            number=(TextView)itemView.findViewById(R.id.no);
            Name=(TextView)itemView.findViewById(R.id.name);
            People=(TextView)itemView.findViewById(R.id.people);
            Estimate=(TextView)itemView.findViewById(R.id.estimate);
            Foodie=(TextView)itemView.findViewById(R.id.foodie);

        }
    }  

```

This is the code for `Json` request

```
 JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET,url,null,
            new Response.Listener<JSONObject>()
            {
                @Override
                public void onResponse(JSONObject response)
                {
                    try
                    {
                        JSONObject object=new JSONObject(response.toString());
                        JSONArray data=object.getJSONArray("results");
                        for(int i=0;i<data.length();i++)
                        {
                           JSONObject json = data.getJSONObject(i);
                            final CurrentEntry c=new CurrentEntry();
                            newUrl=json.getString("foodie");
                            JsonObjectRequest request=new JsonObjectRequest(Request.Method.GET, newUrl, null, new Response.Listener<JSONObject>()
                            {
                                @Override
                                public void onResponse(JSONObject response)
                                {
                                    try
                                    {
                                        String foodie_name=response.getString("username");
                                        c.setFoodie(foodie_name);
                                    } catch (JSONException e)
                                    {
                                        e.printStackTrace();
                                    }
                                    adapter.notifyDataSetChanged();

                                }
                            }, new Response.ErrorListener()
                            {
                                @Override
                                public void onErrorResponse(VolleyError error)
                                {

                                }
                            })
                            {
                                  AppController.getInstance().addToRequestQueue(request,second_req);
                             c.setPeople(json.getString("no_people"));
                             c.setEstimate(json.getString("predicated_time"));
                            current.add(c);
                        }

                    }
                    catch (JSONException e)
                    {

                    }
                    adapter.notifyDataSetChanged();

                }
            },
            new Response.ErrorListener()
            {
                @Override
                public void onErrorResponse(VolleyError error)
                {
                    if (error != null)
                    {
                        //  Log.d(TAG, error.toString())
                        // Toast.makeText(getApplicationContext(), "Enter Valid Username and Password", Toast.LENGTH_LONG).show();
                    }
                }

            })

    };
    AppController.getInstance().addToRequestQueue(req,json_req);

}

```