Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Dirk Bruere at NeoPax Newsgroups: comp.lang.java.programmer Subject: Re: Android: create drawable from path Date: Thu, 14 Apr 2011 21:32:42 +0100 Organization: Dirk Bruere at Neopax Lines: 64 Message-ID: <90p3v4Fe4fU1@mid.individual.net> References: <90opnjFunsU1@mid.individual.net> <908b85be-4c87-4bd6-b5f1-4b82ffeea13e@b13g2000prf.googlegroups.com> Reply-To: dirk.bruere@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net mNs55ZIGjLuoKAVS+VGepweE+oqduR9Khl/b/jDrL94V9F0RlU Cancel-Lock: sha1:3Y2Gki3XuqzWYzf5ZXxMu83oC1g= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: <908b85be-4c87-4bd6-b5f1-4b82ffeea13e@b13g2000prf.googlegroups.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3062 On 14/04/2011 20:06, Lew wrote: > On Apr 14, 1:37 pm, Dirk Bruere at NeoPax > wrote: >> For some reason d=null 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) >> { >> String coverArtURL = coverArtURLStr; >> > > Why the extra 'String' assignment? > > What is the *actual* value of 'coverArtURLStr' at this point when you > have the problem? > >> Drawable d; >> >> if (coverArtURL.equals("")) >> d = Data.defaultCoverArt; >> else >> d = Drawable.createFromPath(coverArtURL); >> > > The value of 'd' at this point when you have the problem is 'null', > you say. > >> Data.coverArtIV.setImageDrawable(d); >> } >> > > 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 > Actually, there is enough information. It seems that Drawable.createFromPath(coverArtURL); doesn't like it if the path is http:\\... I've just got it to work. I'll post the code tomorrow for reference -- Dirk http://www.neopax.com/technomage/ - My new book - Magick and Technology