Most robust way to fetch album art in Android

后端 未结 4 1370
没有蜡笔的小新
没有蜡笔的小新 2020-12-09 23:24

Please note that I have already been through similar questions and their answers here and on other websites. I also have a solution that works on some devices (my G2X runnin

4条回答
  •  一整个雨季
    2020-12-10 00:17

    I'd like to modify Chirag Raval's answer by using Picasso library. It is simple to use and very powerful.

    final Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
        Uri uri = ContentUris.withAppendedId(sArtworkUri, arrayList.get(i).getArt());
        Picasso.with(context).load(uri).placeholder(R.mipmap.ic_launcher).error(R.mipmap.ic_launcher)
                .into(ivPic);
    

    For full documentation, refer this.

提交回复
热议问题