title: Filter a managedQuery by file extension (or, alternatively, file type) for an Android Cursor
body: <p>I want to do a managedQuery using Android SDK where the results returned are filtered by their respective file <em>extension</em> (e.g. not the name, necessarily).  I've done quite a bit of researching and am tired and hoping the community can help me.. I'm sure the answer is out there but, in lieu of reading an SQL book or whatever, I'm just trying to do something that should be pretty simple but not finding the solution.</p>
  
  <p>What I want to do is, essentially, something like:</p>
  
  <pre><code>managedQuery(Audio.Media.EXTERNAL_CONTENT_URI, myProjection, Audio.Media.DATA + " like ? ", new String[] {"%mp3%"}, null );
  </code></pre>
  
  <p>This works EXCEPT that, if the title is something like "mymp3.wav", this query will still return it since 'mp3' is in the name but, that isn't what I want -> I want it filtered purely based on file extension (or, alternatively, file type if there is a way to do that [e.g. if an mp3's file extension name was changed to .wav even though the content of the file is actually mp3, that would work for my purposes as well]).  The solution should indicate a way to filter for multiple extensions/file types (i.e. if I want the query to return all .mp3 files as well as .wav files but not .amr files, for example).</p>
  
  <p>Furthermore, while I have you, I want to sort the results alphabetically.  I have tried something like:</p>
  
  <pre><code>managedQuery(Audio.Media.EXTERNAL_CONTENT_URI, myProjection, null, null, MediaStore.Audio.Media.TITLE + " ASC" );
  </code></pre>
  
  <p>However, that doesn't filter the <em>entire</em> results... that is to say that, the list returned is sorted by, say, mp3 title and then, at the end, it then appends to the list the .wav files also sorted alphabetically but I want the entire list to be alphabetical regardless of file type.</p>
  
  <p>I know someone on here can answer this easily -> thanks in advance!!!</p>