how to sort in the new Firebase database reference (Recyclerview)
<p>I am pulling data from a username structure and I would like to sort by name or username. Is this possible with the new firebase database reference. I have been looking around and I cannot find anything about it. </p>

<p>here is my code:</p>

<pre><code>databaseReference = FirebaseDatabase.getInstance().getReference().child("Users");

}

@Override
protected void onStart() {
    super.onStart();

    FirebaseRecyclerAdapter&lt;addFriends,addFriendsViewHolder&gt; firebaseRecyclerAdapter = new FirebaseRecyclerAdapter&lt;addFriends, addFriendsViewHolder&gt;(
            addFriends.class,
            R.layout.addfriends_row,
            addFriendsViewHolder.class,
            databaseReference
    ) {
        @Override
        protected void populateViewHolder(addFriendsViewHolder viewHolder, addFriends model, int position) {
            viewHolder.setName(model.getName());
            viewHolder.setUsername(model.getUsername());
        }
    };
    addfriendsRecyclerView.setAdapter(firebaseRecyclerAdapter);
}
</code></pre>

<p>here is my structure in firebase:</p>

<pre><code>{
  "asdadafdsgsaasfsa" : {
    "name" : "juanito",
    "username" : "cacadeperro22"
  },
  "dasdsadadaf" : {
    "name" : "cucu",
    "username" : "dsadadas"
  },
  "dsadasddsa" : {
    "name" : "username",
    "username" : "pisad"
  },
  "dsdsada" : {
    "name" : "name",
    "username" : "username"
  },
  "qUYxycDlMwYZ6r2WSA1TAacbdPh1" : {
    "email" : "elvis0288@hotmail.com",
    "name" : "Elvis De Abreu",
    "username" : "elvis0288"
  },
  "qadfdafa" : {
    "name" : "Josue Caca",
    "username" : "chupapenes"
  },
  "x123" : {
    "name" : "fsf",
    "username" : "dadfasfd"
  },
  "xxxxxx" : {
    "name" : "123",
    "username" : "culo"
  }
}
</code></pre>

<p>Thanks!</p>