Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx01.iad01.newshosting.com!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!b13g2000prf.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Android: create drawable from path Date: Thu, 14 Apr 2011 12:06:47 -0700 (PDT) Organization: http://groups.google.com Lines: 51 Message-ID: <908b85be-4c87-4bd6-b5f1-4b82ffeea13e@b13g2000prf.googlegroups.com> References: <90opnjFunsU1@mid.individual.net> NNTP-Posting-Host: 64.215.87.3 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1302808008 19950 127.0.0.1 (14 Apr 2011 19:06:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 14 Apr 2011 19:06:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b13g2000prf.googlegroups.com; posting-host=64.215.87.3; posting-account=IZs2IgoAAACGaj2oD74Zp9JDhkUk-os6 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8),gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3061 On Apr 14, 1:37=A0pm, Dirk Bruere at NeoPax wrote: > For some reason d=3Dnull when creating a drawable from coverArtURLStr, > which is the full http path to the resource on the LAN. > Are you certain that value is what the method sees? > 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) > =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 String coverArtURL =3D coverArtURLStr; > Why the extra 'String' assignment? What is the *actual* value of 'coverArtURLStr' at this point when you have the problem? > =A0 =A0 =A0 =A0 Drawable d; > > =A0 =A0 =A0 =A0 if (coverArtURL.equals("")) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 d =3D Data.defaultCoverArt; > =A0 =A0 =A0 =A0 else =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 d =3D Drawable.createFromPath(coverArtURL= ); > The value of 'd' at this point when you have the problem is 'null', you say. > =A0 =A0 =A0 =A0 Data.coverArtIV.setImageDrawable(d); > =A0 =A0 =A0} > When you say "I can access the LAN OK", that may or may not bear on whether your program can access the LAN when you're running your test. There's insufficient information in your post for us to know. Since you have not provided an SSCCE there's little likelihood we can debug your problem. On the face of it the'createFromPath()' method is unable to access the actual URL string you're giving it, a datum you have omitted from your problem statement. Provide an SSCCE, please. -- Lew