Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of users not visible in chat tab and users tab #10

Open
karthik3168 opened this issue Dec 11, 2020 · 6 comments
Open

List of users not visible in chat tab and users tab #10

karthik3168 opened this issue Dec 11, 2020 · 6 comments

Comments

@karthik3168
Copy link

I created two accounts in firebase. The two accounts are working fine in firebase but the list of users are not showing in recyclerview. So please solve my issue as soon as possible.

@Way4ward17
Copy link

Can u share ur code

@karthik3168
Copy link
Author

karthik3168 commented Dec 11, 2020 via email

@karthik3168
Copy link
Author

Can anyone help me?

@TapanManu
Copy link

Are you trying to populate your recycleview with names of each user? Isn't it?

@TapanManu
Copy link

TapanManu commented Dec 26, 2020

I assume it like that since I was unable to view your code. If you wanna populate the recycle view items with the name of each users, then try the following with this . This is the part of code snippet within onDataChanged() method within addEventListener

            if(users!=null)
                users.clear();
            for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                //User user = snapshot.getValue(User.class);
                String key = snapshot.getKey();
                String username = snapshot.child("username").getValue(String.class);
                String email = snapshot.child("email").getValue(String.class);

                User user = new User(key,username,email);


                if (user != null && user.getId() != null && firebaseUser != null && !user.getId().equals(firebaseUser.getUid())) {
                    Log.d("ui",user.getId());
                    users.add(user);
                }
            }

            myAdapter = new UserAdapter(context, users);
            recyclerView.setAdapter(myAdapter);


        }

`

My User class is slightly modified . So does the constructor invocation

@karthik3168
Copy link
Author

karthik3168 commented Dec 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants