title: Firebase database get all child
body: <p>I want to get all child from my database. I tried almost similar code like is on YouTube posted by Google Developers, but there were made changes since then. I just want to take all informations that are bellow userdata (there are profiles of users).
  My database looks like:
  <a href="https://i.stack.imgur.com/Ybc4S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ybc4S.png" alt="tree representation of data"></a></p>
  
  <p>and I want to get all informations that are under <strong><code>userdata</code></strong>
  Here is my code.</p>
  
  <pre><code>FirebaseDatabase database5 = FirebaseDatabase.getInstance();
      DatabaseReference myRef5 = database5.getReference("userdata");
  
      myRef5.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              // This method is called once with the initial value and again
              // whenever data at this location is updated.
              Map&lt;String, String&gt; map = dataSnapshot.getValue(Map.class);
              map.getClass();
              Log.i("Mufz", "Value is: " + map.getClass());
  
  
   //                Toast.makeText(getApplicationContext(), `value3.toString(), Toast.LENGTH_SHORT).show();`
  
          }
  
          @Override
          public void onCancelled(DatabaseError error) {
              // Failed to read value
              Log.w("TAG", "Failed to read value.", error.toException());
  //                Toast.makeText(getApplicationContext(), error.toException().toString(), Toast.LENGTH_SHORT).show();
          }
  
      });
  </code></pre>
  
  <p>after running this there nothing happens and it runs prevoroius activity or there come error</p>
  
  <pre><code>08-16 19:29:47.225 32507-32507/com.samo.facedatefb E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: com.samo.facedatefb, PID: 32507
                                                                   com.google.firebase.database.DatabaseException: Class java.util.Map has generic type parameters, please use GenericTypeIndicator instead
                                                                       at com.google.android.gms.internal.zzaln.zzb(Unknown Source)
                                                                       at com.google.android.gms.internal.zzaln.zza(Unknown Source)
                                                                       at com.google.firebase.database.DataSnapshot.getValue(Unknown Source)
                                                                       at com.samo.facedatefb.MapsActivity$3.onDataChange(MapsActivity.java:306)
                                                                       at com.google.android.gms.internal.zzaie.zza(Unknown Source)
                                                                       at com.google.android.gms.internal.zzaje.zzcta(Unknown Source)
                                                                       at com.google.android.gms.internal.zzajh$1.run(Unknown Source)
                                                                       at android.os.Handler.handleCallback(Handler.java:815)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:104)
                                                                       at android.os.Looper.loop(Looper.java:194)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5549)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at java.lang.reflect.Method.invoke(Method.java:372)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
  </code></pre>
  
  <p>Where could be a problem? Thanks.</p>