title: Android Firebase Database - Retrieving data sorted by timestamp
body: <p>I am developing an Android app that uses Firebase database. To use the app, the user has to create an account and log-in. I save the account info in Firebase Database.</p>
  
  <p><a href="https://i.stack.imgur.com/DauNL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DauNL.png" alt="enter image description here"></a></p>
  
  <p>The app is retrieving the user list from Firebase. How can I retrieve the user lists by the time they joined (sorted by the timestamp)? I tried this:</p>
  
  <pre><code>    DatabaseReference firebaseAskRef = FirebaseDatabase.getInstance().getReference(Constants.FIREBASE_LOCATION_ASKS_LIST);
      Query query = firebaseAskRef.orderByChild("timestampPosted/timestamp");
      adapter= new UserAdapter(getActivity(), User.class,R.layout.ask_item, ViewHolder.class,query);
  </code></pre>
  
  <p>But it's not working. Could you give any suggestions?</p>