I want to retrieve only the date and all the date element at once and store them in array in the firebase as shown below.
i have used the following code to retrieve but failed to that.
public void showData(View view) {
final ArrayList<String> date = new ArrayList<>();
firebaseDatabase = FirebaseDatabase.getInstance().getReference().child("Date");
firebaseDatabase.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
date.add(dataSnapshot.getValue().toString());
display.setText(dataSnapshot.getValue().toString());
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
Please help to find a solution for this.