Why am I getting null when trying to decode file from URL to post to Facebook from Android app -


this code:

        byte[] data;         bitmap bi = bitmapfactory.decodefile(myimageurl);         bytearrayoutputstream baos = new bytearrayoutputstream();         bi.compress(bitmap.compressformat.png, 100, baos);         data = baos.tobytearray(); 

a detail that, in logcat, see error:

java.io.filenotfoundexception: <image url> (no such file or directory) 

after this, null pointer exception because variavle bi null. url contains image. why happens?

thank you!


Comments

Popular posts from this blog

How can I fetch data from a web server in an android application? -

Change php variable from jquery value using ajax (same page) -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -