title: Function returns null although data is fetched from firebase
body: <p>I am working on a project on Android Studio with libGDX and I have connected the game to firebase which is working perfectly.</p>
  <p>When I am trying to fetch some data, the firebase returns proper expected values, but the function is returning a null value.</p>
  <pre><code>public String fetchData(String id)
  {
      reference = FirebaseDatabase.
              getInstance().getReference(&quot;Users&quot;).
              child(FirebaseAuth.getInstance().getCurrentUser().getUid());
      reference.addListenerForSingleValueEvent(new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot snapshot) {
              s = snapshot.child(id).getValue(String.class); //Here if we print s it gives the desired output.
          }
  
          @Override
          public void onCancelled(@NonNull DatabaseError error) {
  
          }
      });
  
      return s; // But here the function is returning null.
  }
  
  
  @Override
      public String Background_Active() { 
          return fetchData(&quot;Background Active&quot;); //Here I am calling the above function 
      }
  </code></pre>
  <p>If someone is aware of the solution to this issue, please do help me out.</p>