Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Android URI to drawable Date: Thu, 3 Nov 2011 19:15:24 -0700 (PDT) Organization: http://groups.google.com Lines: 32 Message-ID: <7367201.498.1320372924453.JavaMail.geo-discussion-forums@prep8> References: <9hgtnoF760U1@mid.individual.net> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 66.109.106.5 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1320373030 1886 127.0.0.1 (4 Nov 2011 02:17:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 4 Nov 2011 02:17:10 +0000 (UTC) In-Reply-To: <9hgtnoF760U1@mid.individual.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.109.106.5; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9497 Dirk Bruere at NeoPax wrote: > Drawable d =3D=20 > Drawable.createFromPath("e:\\Config\\$NetRadioCovers\\Other\\96.7=20 > Ashbourne Radio.jpg"); >=20 > This returns null, even though the path is correct. > Any ideas on how to do it? Here is a lesson in why you should put all the necessary information in the= body of your post, and not just in the subject. Your subject refers to "A= ndroid URI", but the body of your post talks about a Windows path. That is= confusing. Regardless, the evidence from the tiny bit of information you provide is th= at the path is most definitely *not* correct. At the very least, you shoul= d re-examine that assumption and take steps to prove it. (E.g., write a un= it test that test for something like 'new File("your path").exists()'.) Do= n't assume the path is right, prove that it's right. I will bet you fifty = bucks that it isn't. (Monopoly money only.) Please give ocmplete information in your post. Is this a Windows problem o= r an Android problem? If this is Android, then the path isn't even correct= ly formatted, much less correct. You should consider using 'System.getProperty("file.separator")' or equival= ent instead of hard-coding non-portable idioms. Also, I see no evidence of a URI in your code snippet. How does that figur= e in? --=20 Lew