I want to access the img but when I try nothing works
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("med");
System.out.println(myRef);
System.out.println(database.getReference().child("med"));
database.getReference().child("med").addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
System.out.println("11111111");
}
@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
Log.w(TAG, "Failed to read value.", error.toException());
}
});
Even 11111111 is not printed when I enter the onDataChange function
What's the problem and how do I get the data I need?