Android: Fix widget albumart display on pre-2.2 devices.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29600 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2011-03-16 11:38:49 +00:00
parent a0c664850c
commit efa9f13500

View file

@ -166,8 +166,11 @@ public class RockboxWidgetProvider extends AppWidgetProvider
CharSequence album = args.getCharSequenceExtra("album"); CharSequence album = args.getCharSequenceExtra("album");
views.setTextViewText(R.id.infoDisplay, title+"\n"+artist+"\n"+album); views.setTextViewText(R.id.infoDisplay, title+"\n"+artist+"\n"+album);
CharSequence albumart = args.getCharSequenceExtra("albumart"); CharSequence albumart = args.getCharSequenceExtra("albumart");
/* Uri.fromFile() is buggy in <2.2
* http://stackoverflow.com/questions/3004713/get-content-uri-from-file-path-in-android */
if (albumart != null) if (albumart != null)
views.setImageViewUri(R.id.logo, Uri.fromFile(new File(albumart.toString()))); views.setImageViewUri(R.id.logo, Uri.parse(
new File(albumart.toString()).toString()));
else else
views.setImageViewResource(R.id.logo, R.drawable.rockbox); views.setImageViewResource(R.id.logo, R.drawable.rockbox);
} }