title: how to display thumbnail of song in android?
body: <p>I am displaying all songs from SDCard with all information like TITLE,ARTIST,ALBUM etc.</p>
  
  <p>But I am getting problem with song thumbnail image. How to get song thumbnail.?</p>
  
  <p>Following is my code.</p>
  
  <pre><code>public class AndroidListMediaActivity extends ListActivity {
  
   SimpleCursorAdapter adapter;
   MediaPlayer myMediaPlayer;
  
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String[] from = {
          MediaStore.MediaColumns.TITLE};
        int[] to = {
          android.R.id.text1};
  
        Cursor cursor = managedQuery(
          MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
          null,
          null,
          null,
          MediaStore.Audio.Media.TITLE);
  
        adapter = new SimpleCursorAdapter(this,
          android.R.layout.simple_list_item_1, cursor, from, to);
        setListAdapter(adapter);
    }
  
   @Override
   protected void onListItemClick(ListView l, View v, int position, long id) {
    Cursor cursor = adapter.getCursor();
    cursor.moveToPosition(position);
  
    String _id = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media._ID));
    String title = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.TITLE));
    String artist = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST));
    String album = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.ALBUM));
    int duration = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media.DURATION));
  
    Uri playableUri
     = Uri.withAppendedPath(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, _id);
    myMediaPlayer = MediaPlayer.create(getBaseContext(), playableUri);
    String msgMediaPlayer;
    if(myMediaPlayer != null){
     myMediaPlayer.start();
     msgMediaPlayer = "Playing: " + playableUri + "\n";
    }else{
     msgMediaPlayer = "Cannot play: " + playableUri + "\n";
    }
  
    String info = msgMediaPlayer + "\n"
       + "_ID: " + _id + "\n"
       + "TITLE: " + title + "\n"
       + "ARTIST: " + artist + "\n"
       + "ALBUM: " + album + "\n"
       + "DURATION: " + duration/1000 + "s";
  
    Toast.makeText(this, info, Toast.LENGTH_LONG).show();
   }
  
  }
  </code></pre>