Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static List<UserPayer> getAllPayees(String myUid) {
- List<String> bids = new ArrayList<>();
- //asynchronously retrieve all documents
- ApiFuture<QuerySnapshot> future = db.collection("debts").get();
- // future.get() blocks on response
- List<QueryDocumentSnapshot> documents = null;
- try {
- documents = future.get().getDocuments();
- } catch (InterruptedException e) {
- e.printStackTrace();
- } catch (ExecutionException e) {
- e.printStackTrace();
- }
- for (QueryDocumentSnapshot document : documents) {
- System.out.println(document.getId() + "\n");
- bids.add(document.getId());
- }
- List<UserPayer> users = new ArrayList<>();
- for (String s: bids) {
- List<UserPayer> temp = getPayers(s);
- for (UserPayer: temp) {
- if (u.uid.equals(myUid)) {
- users.add(u);
- }
- }
- }
- return users;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement