title: Android Studio Double Value Event Listener
body: <p>First of all hello guys. I am trying to do if bolum == duyuruBolum then i can get the datas from firebase. I can't use double value event listener because when i do that i just get the bolum data. I want to take both of them. What should i do?</p>
  
  <p>This is my function:</p>
  
  <pre><code>public void bolumKontrol() {
      Duyuru duyuru = new Duyuru();
      DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();
      DatabaseReference ogrenciRef = rootRef.child("Ogrenci");
      DatabaseReference duyuruRef = rootRef.child("Duyuru");
      user = FirebaseAuth.getInstance().getCurrentUser();
      uid = user.getUid();
      final String pid = duyuru.getPid();
  
      ValueEventListener eventListener = new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
              for (DataSnapshot ds: dataSnapshot.getChildren()) {
                  String bolum = dataSnapshot.child(uid).child("bolumler").getValue(String.class);
                  String duyuruBolum = dataSnapshot.child(pid).child("bolum").getValue(String.class);
                  if (bolum.equals(duyuruBolum)) {
                      getDataFromFirebase();
                  }
                  Toast.makeText(OgrenciDuyuruActivity.this,duyuruBolum + bolum,Toast.LENGTH_LONG).show();
              }
  
          }
  
          @Override
          public void onCancelled(@NonNull DatabaseError databaseError) {
  
          }
      };
      ogrenciRef.addValueEventListener(eventListener);
      duyuruRef.addValueEventListener(eventListener);
  }
  </code></pre>