title: sorting by date in firebase database
body: <p>I have a database that looks like this:</p>
  <pre><code>{
  firstitem : {
  &quot;name&quot; : &quot;first_item_name&quot;,
  &quot;date&quot; : &quot;29/11/2018&quot;,
  &quot;user&quot; : &quot;random user&quot;,
  &quot;url&quot; : &quot;My Url&quot;,
  &quot;tag&quot; : &quot;firstitem&quot;
  },
  seconditem : {
  &quot;name&quot; : &quot;second_item_name&quot;,
  &quot;date&quot; : &quot;20/11/2018&quot;
  &quot;user&quot; : &quot;another user&quot;,
  &quot;url&quot;  : &quot;a url&quot;,
  &quot;tag&quot;  : &quot;seconditem&quot; 
  },  
  thirditem : {
  &quot;name&quot; : &quot;third_item_name&quot;,
  &quot;date&quot; : &quot;20/11/2017&quot;
  &quot;user&quot; : &quot;another user&quot;,
  &quot;url&quot;  : &quot;a url&quot;,
  &quot;tag&quot;  : &quot;thirditem&quot;   
  }
   ect....
  }
  </code></pre>
  <p>I want to be able to have an option to sort by date, starting at the newest, and descending to the oldest. How can I achieve this?</p>
  <p>This is my method for calling the firebase strings at the moment:</p>
  <pre><code>if (dataSnapshot.exists()) {
          Log.i(&quot;Event&quot;, &quot;Added&quot;);
  
          Firebase_Strings dlStrings = dataSnapshot.getValue(Firebase_Strings.class);
          p9p_strings.DOCUMENTARY_NAME.add(dlStrings.name);
          p9p_strings.DOCUMENTARY_SYNOPSIS.add(dlStrings.about);
          p9p_strings.DOCUMENTARY_URL.add(dlStrings.url);
          p9p_strings.DOCUMENTARY_UPLOADED.add(dlStrings.date);
          p9p_strings.DOCUMENTARY_TAG.add(dlStrings.tag);
  </code></pre>