title: How to query contentresolver between two dates?
body: <p>How to query content resolver (<code>MediaStore.Images.Media.EXTERNAL_CONTENT_URI</code>) between two dates? I am trying following code but this is not working.</p>
  
  <pre><code>Calendar c = Calendar.getInstance()
  Date date2 = c.getTime();
  c.add(Calendar.YEAR,-1);
  Date date1 = c.getTime();
  Cursor cursor = getContentResolver().query( 
                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, 
                    projection, 
                    MediaStore.MediaColumns.DATE_ADDED + "&gt;=? and "+MediaStore.MediaColumns.DATE_ADDED +"&lt;=?", 
                    new String[]{"" + date1,""+date2}, 
                    MediaStore.Images.ImageColumns.DATE_TAKEN + " DESC");
  </code></pre>