How to use searchbar on firebase database using recycler view?

I want to search through the recycler view from firebase database..I have tried the search bar with the below code but i do not get any results its just blank..
This is the code that i have tried no errors but blank

enter code here
public boolean onCreateOptionsMenu(Menu menu)
{
    getMenuInflater().inflate(R.menu.menu,menu);

    MenuItem item=menu.findItem(R.id.search);

    SearchView searchView=(SearchView)item.getActionView();

    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String s) {
            processsearch(s);
            return false;
        }

        @Override
        public boolean onQueryTextChange(String s) {
            processsearch(s);
            return false;
        }
    });

    return super.onCreateOptionsMenu(menu);
}

private void processsearch(String s)
{
    FirebaseRecyclerOptions<person> options =
            new FirebaseRecyclerOptions.Builder<person>()
                    .setQuery(FirebaseDatabase.getInstance().getReference("Candidates").startAt(s).endAt(s+"uf8ff"),person.class)
                    .build();

    adapter=new personAdapter(options);
    adapter.startListening();
    recyclerView.setAdapter(adapter);

}

}
`

Source: Android Studio Questions

LEAVE A COMMENT