In my android application following bitmap code shows exception -


in android application contact details contacts following code used able name , phone number bitmap code shows exception

bitmap bitmap = null; string image_uri = "";   image_uri = cur.getstring(cur.getcolumnindex(contactscontract.commondatakinds.phone.photo_id));   if (image_uri != null) {     system.out.println(uri.parse(image_uri));     log.d("image",image_uri);     try {         bitmap = mediastore.images.media.getbitmap(         this.getcontentresolver(),         uri.parse(image_uri));         //      toast.maketext(getapplicationcontext(), ""+bitmap,toast.length_long).show();         bytearrayoutputstream stream = new bytearrayoutputstream();         bitmap.compress(bitmap.compressformat.png, 100, stream);         bytearray = stream.tobytearray();         } catch (filenotfoundexception e) {             // todo auto-generated catch block             e.printstacktrace();         } catch (ioexception e) {             // todo auto-generated catch block             e.printstacktrace();         }      } 

logcat error:

07-31 06:50:15.114: e/androidruntime(1734): java.lang.runtimeexception: unable start activity componentinfo{com.androidhive.androidsqlite/com.androidhive.androidsqlite.androidsqlitetutorialactivity}: java.lang.nullpointerexception 07-31 06:50:15.114: e/androidruntime(1734):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 07-31 06:50:15.114: e/androidruntime(1734):     @ dalvik.system.nativestart.main(native method) 07-31 06:50:15.114: e/androidruntime(1734):     @ com.androidhive.androidsqlite.androidsqlitetutorialactivity.oncreate(androidsqlitetutorialactivity.java:79) 


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -