0

I'm trying to retrieve list of users by their names after text changes in edittext but not able to display anything.

FirebaseRecyclerAdapter

        @Override
        public void afterTextChanged(Editable editable) {
            String typedText = editable.toString();

            query = mDatabase.child("users").orderByChild("name").startAt(typedText).endAt(typedText+"\uf8ff");

            firebaseRecyclerOptions = new FirebaseRecyclerOptions.Builder<UserModel_member_DP_NAME>().setQuery(query,UserModel_member_DP_NAME.class).build();

            firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<UserModel_member_DP_NAME, User_MemberHolder>(firebaseRecyclerOptions) {
                @Override
                protected void onBindViewHolder(final User_MemberHolder holder, int position, final UserModel_member_DP_NAME model) {
                    holder.setContent(holder.itemView.getContext(),model.getDp(),model.getName());

                }
                @Override
                public User_MemberHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                    View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.set_meeting_userlist_item,parent,false);
                    return new User_MemberHolder(v);
                }
            };
            recyclerView.setAdapter(firebaseRecyclerAdapter);
        }

ViewHolder

private class User_MemberHolder extends RecyclerView.ViewHolder{
    ImageView img;
    TextView txt;
    User_MemberHolder(View itemView) {
        super(itemView);
        img = itemView.findViewById(R.id.set_meeting_userlist_imgview);
        txt = itemView.findViewById(R.id.set_meeting_userlist_txtview);

    }
    void setContent(Context context, String imgUri , String nameString){
        txt.setText(nameString);
        Picasso.with(context).load(imgUri).into(img);
    }
}
parag pawar
  • 193
  • 3
  • 13
  • Possible duplicate of [Applying Word Stemming in SearchView for fetch data from Firebase database](https://stackoverflow.com/questions/50682046/applying-word-stemming-in-searchview-for-fetch-data-from-firebase-database) – Alex Mamo Jun 11 '18 at 17:22
  • Please check the duplicate to see how you can achieve this, by creating a new adapter object each time you search. – Alex Mamo Jun 11 '18 at 17:22
  • Yes i checked it. Can you gve code snippet to put me on right path @Alex Mano – parag pawar Jun 12 '18 at 12:23
  • You should make you own attempt given the information in the duplicate, and ask another question if something else comes up. – Alex Mamo Jun 12 '18 at 12:36

0 Answers0