Q: Realtime Firebase User id Fetching Problem public class UserId {
public String user_id;
public <T extends UserId> T withId(@NonNull final String id){
    this.user_id=id;
    return(T) this;
}
 }         
    @Override
    public void onStart() {
    super.onStart();
    firebaseFirestore.collection("Users").addSnapshotListener(new 
     EventListener<QuerySnapshot>() {
        @Override
        public void onEvent(QuerySnapshot documentSnapshots, 
    FirebaseFirestoreException e) {
            usersList.clear();
            for(DocumentChange ds:documentSnapshots.getDocumentChanges()){
                if(ds.getType()==DocumentChange.Type.ADDED){
                    String user_id=ds.getDocument().getId();
                    Users 
           users=ds.getDocument().toObject(Users.class).withId(user_id);
                    usersList.add(users);
                    userAdapter.notifyDataSetChanged();
                }
            }

        }
    });
     }

In fire store I use  these line  
( 
  String user_id=ds.getDocument().getId();
  Users users=ds.getDocument().toObject(Users.class).withId(user_id);    
) 

but in realtime firebase what can I use?
I use this method in fire store to get id of user. Now I work on real time database and I want to retrieve user id here So please help me hoe can I do it?
       @Override
  public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) {
    posi=position;
    ChatUsers listItems = listitem.get(position);
    viewHolder.name.setText(listItems.getName());
    viewHolder.status.setText(listItems.getStatus());
    String thumb_img=listItems.getThumb_img();
    RequestOptions requestOptions=new RequestOptions();
    requestOptions.placeholder(R.drawable.defaultimage);
    Glide.with(context).setDefaultRequestOptions(requestOptions)
  .load(thumb_img).into(viewHolder.img);
    viewHolder.v1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            Toast.makeText(context,"jj",Toast.LENGTH_LONG).show();
         Intend in=new Intent(this,Setting.class);
   //  here I want to send user id 

        }
    });
        Picasso.with(context).load(thumb_img).
       placeholder(R.drawable.bus2).into(viewHolder.img);
}


A: for (QueryDocumentSnapshot document : task.getResult()) {
    Log.d(TAG, document.getId() + " => " + document.getData());
}

