Answer the question
In order to leave comments, you need to log in
How to display information about a FireBase user?
there is such a user base and it is necessary to display the names of all users in the console (but I can only display the name of one user whom I know)
package com.sanke.ilafedoseev.talkchat.UI;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.sanke.ilafedoseev.talkchat.R;
import java.util.HashMap;
public class SearchActivity extends AppCompatActivity {
private DatabaseReference myRef;
private FirebaseDatabase mFirebaseDatabase;
private HashMap<String,String> usersList = new HashMap<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
mFirebaseDatabase = FirebaseDatabase.getInstance();
myRef = mFirebaseDatabase.getReference();
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// Как написать правильно код здесь ?
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question