0000

http://hi.baidu.com/lck0502/blog/item/8cecf1596a88f4272934f01d.html

http://blog.csdn.net/ameyume/archive/2011/03/22/6267946.aspx

ContentResolver resolver = getBaseContext().getContentResolver();
    if(resolver != null){
     Cursor cursor = resolver.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
     count = cursor.getCount();
     
      while(cursor.moveToNext()){
       int id = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media._ID));
       String songName = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE));
       String albumName = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM));
       String albumId = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM_ID));
       String singerName = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST));
       String dataPath = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA));
       String year = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.YEAR));
       Bitmap bm = Common.getArtworkFromFile(PushMusicActivity.this,id,Integer.parseInt(albumId));
       
       }

你可能感兴趣的:(html,.net,Blog)