Hi,

i am having similar problem,

i am getting FileNotFoundException when run this command.

FileInputStream fileToRead = new FileInputStream(fileName);

here fileName is a string "content://media/external/images/media/6" by
android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI image
selction in sdcard.

any solution?


On Feb 24, 1:22 am, Freddy <f...@charter.net> wrote:
> I'm running android sdk v1.1-r1 testing with a T-Mobile G1 device
> HT841GZ04082.
>
> I have a jpg on the sdcard that I want to add to the photo viewer.  I
> do this quite simply with the test code
>
>    Bitmap bm = BitmapFactory.decodeFile("/sdcard/test.jpg");
>    String test = Images.Media.insertImage(getContentResolver(), bm,
> "title", "desciption");
>
> which appears to work fine.  I receive a value for bm and test is
> "content://media/external/images/media/163" or such.  All great to
> this point....yuppie!
>
> Now the problem; when I launch photo viewer from the home screen it
> always crashes until I reset the phone.  Here's the crash dump with an
> uncaught exception.  I assume this is a bug in the andoid photo
> viewer.  Can anyone verify this and/or let me know how else I can add
> an existing jpg to the photo viewer without crashing the app?
>
> Thanks.
>
> 02-23 16:47:09.152: ERROR/AndroidRuntime(368): Uncaught handler:
> thread main exiting due to uncaught exception
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):
> java.lang.RuntimeException: Unable to resume activity
> {com.android.camera/com.android.camera.GalleryPicker}:
> java.lang.NullPointerException
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.ActivityThread.performResumeActivity(ActivityThread.java:
> 2505)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.ActivityThread.handleResumeActivity(ActivityThread.java:
> 2520)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2160)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.os.Handler.dispatchMessage(Handler.java:88)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.os.Looper.loop(Looper.java:123)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.ActivityThread.main(ActivityThread.java:3739)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> java.lang.reflect.Method.invoke(Method.java:515)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:739)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> dalvik.system.NativeStart.main(Native Method)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368): Caused by:
> java.lang.NullPointerException
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> com.android.camera.GalleryPicker$GalleryPickerAdapter.init
> (GalleryPicker.java:251)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> com.android.camera.GalleryPicker.rebake(GalleryPicker.java:96)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> com.android.camera.GalleryPicker.onResume(GalleryPicker.java:435)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.Instrumentation.callActivityOnResume(Instrumentation.java:
> 1224)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.Activity.performResume(Activity.java:3359)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     at
> android.app.ActivityThread.performResumeActivity(ActivityThread.java:
> 2492)
> 02-23 16:47:09.162: ERROR/AndroidRuntime(368):     ... 12 more
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to