Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. followingList = new ArrayList<>();
  2. DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Users")
  3. .child( FirebaseAuth.getInstance().getCurrentUser().getUid())
  4. .child("productos");
  5.  
  6. reference.addValueEventListener(new ValueEventListener() {
  7. @Override
  8. public void onDataChange(DataSnapshot dataSnapshot) {
  9. followingList.clear();
  10. for (DataSnapshot snapshot : dataSnapshot.getChildren()){
  11. followingList.add(snapshot.getKey());
  12. }
  13. }
  14.  
  15. @Override
  16. public void onCancelled(@NonNull DatabaseError databaseError) {
  17.  
  18. }});
  19.  
  20. "productos" : {
  21. "-LaSV9Nxwrz58Oe8sLwE" : {
  22. "-LaQoiF-_v_1BsEiqU7v" : true
  23. },
  24. "-LaSXD7-B6E51QRMMoWp" : {
  25. "-LaQoiF-_v_1BsEiqU7v" : true
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement