create drawable from path problem
For some reason d=null when creating a drawable from coverArtURLStr, which is the full http path to the resource on the LAN. Anything obvious wrong? It's a path to a .png [I can access the LAN OK, and Data.defaultCoverArt works fine]
public static void updateCoverArt(String coverArtURLStr)
{
String coverArtURL = coverArtURLStr;
Drawable d;
if (coverArtURL.equals(""))
d = Data.de开发者_Go百科faultCoverArt;
else
d = Drawable.createFromPath(coverArtURL);
Data.coverArtIV.setImageDrawable(d);
}
I don't think Drawable.createFromPath()
method can handle URLs. Try this solution Android Drawable Images from URL.
精彩评论