Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void getOrderID() {
- for (int i = 0; i < userID.size(); i++) {
- databaseReference.child(opearatorID).child(userID.get(i)).addValueEventListener(new ValueEventListener() {
- @Override
- public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
- for (DataSnapshot childSnapshot : dataSnapshot.getChildren()) {
- keyStatusRelation.put(childSnapshot.getKey(),childSnapshot.getValue(Order.class).getStatus());
- }
- loadData();
- }
- @Override
- public void onCancelled(@NonNull DatabaseError databaseError) {
- }
- });
- }
- }
- public static void loadData() {
- for (int i=0;i<userID.size();i++){
- statusRefrenceLiving.child(userID.get(i)).addValueEventListener(new ValueEventListener() {
- @Override
- public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
- for (DataSnapshot childSnapshot : dataSnapshot.getChildren()) {
- Order order = childSnapshot.getValue(Order.class);
- if(keyStatusRelation.get(childSnapshot.getKey()).equals("0")||keyStatusRelation.get(childSnapshot.getKey()).equals("2")){
- bookingmList.add(order);
- bookingrecyclerView.setAdapter(bookingAdapter);
- }
- if(keyStatusRelation.get(childSnapshot.getKey()).equals("1")){
- bookedmList.add(order);
- bookedrecycleView.setAdapter(bookedAdapter);
- }
- if(keyStatusRelation.get(childSnapshot.getKey()).equals("3")){
- LivingmList.add(order);
- LivingrecycleView.setAdapter(livingAdapter);
- }
- }
- }
- @Override
- public void onCancelled (@NonNull DatabaseError databaseError){
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement