I've searched numerous questions throughout stackoverflow but still I'm unable to get my answer. Nothing comes up when i begin typing with lower case alphabets in my searchview. I would like to be able to begin typing with upper case or lower case letter to be able to filter through my list of recycler card views. Also if i could filter it by typing any character that is found in a word without following the alphabet sequence of a particular word. Below is my onQueryTextChange
@Override
public boolean onQueryTextChange(String newText) {
Query search = mDatabaseReference.orderByChild("country").startAt(newText).endAt(newText+"\uf8ff");
FirebaseRecyclerAdapter<CardItem, SearchViewHolder> firebaseRecyclerAdapter22
= new FirebaseRecyclerAdapter<CardItem, SearchViewHolder>(
CardItem.class,
R.layout.single_card,
SearchViewHolder.class,
search
) {
@Override
protected void populateViewHolder(final SearchViewHolder hiViewHolder, final CardItem model, int position) {
hiViewHolder.setPicture(model.getThumbPhoto() , getApplicationContext());
hiViewHolder.setTitle(model.getTitle());
hiViewHolder.setCountry(model.getCountry());
hiViewHolder.setPrice("Price: $" + model.getPricePerGuest());
}
};
mTripList.setAdapter(firebaseRecyclerAdapter22);
return false;
}
});
return super.onCreateOptionsMenu(menu);
}
I've tried setting newText to lowerCase as follow but it causes me to not able to filter anything from my SearchView:
@Override
public boolean onQueryTextChange(String newText) {
newText = newText.toLowerCase();
Query search = mDatabaseReference.orderByChild("country").startAt(newText).endAt(newText+"\uf8ff");
FirebaseRecyclerAdapter<CardItem, SearchViewHolder> firebaseRecyclerAdapter22
= new FirebaseRecyclerAdapter<CardItem, SearchViewHolder>(
CardItem.class,
R.layout.single_card,
SearchViewHolder.class,
search
) {
@Override
protected void populateViewHolder(final SearchViewHolder hiViewHolder, final CardItem model, int position) {
hiViewHolder.setPicture(model.getThumbPhoto() , getApplicationContext());
hiViewHolder.setTitle(model.getTitle());
hiViewHolder.setCountry(model.getCountry());
hiViewHolder.setPrice("Price: $" + model.getPricePerGuest());
}
};
mTripList.setAdapter(firebaseRecyclerAdapter22);
return false;
}
});
return super.onCreateOptionsMenu(menu);
}