title: Retrieve specific value from Firebase database into string variable
body: <p>I'm trying to retrieve a specific value from a Firebase realtime Database.</p>
  
  <p>The data looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/0mJqX.jpg" alt=" The data looks like this;">
  <br></p>
  
  <p>I want to get the URL value from any of them and then put it into a string variable to use later. This is so that the program does not need to be changed if the download link is changed. The code I have so far is;</p>
  
  <pre><code>DatabaseReference fdb = FirebaseDatabase.getInstance().getReference();
  //Query query = fdb.child("URLDOWNLOADS").child("WSSeasons")
  fdb.addListenerForSingleValueEvent(new ValueEventListener()
  {
      @Override
      public void onDataChange(@NonNull DataSnapshot dataSnapshot)
      {
          for (DataSnapshot url : dataSnapshot.getChildren())
          {
              LoginInfoFirebasedb DownURL = url.getValue(LoginInfoFirebasedb.class);
              String temp = DownURL.dwldURL;
              URL1 = temp;
          }
      }
  
      @Override
      public void onCancelled(@NonNull DatabaseError databaseError)
      {
  
      }
  });
  </code></pre>
  
  <p>Some help would be seriously appreciated. I understand this may be a simple problem but I am stumped.</p>