Workaround is here: http://jimmi1977.blogspot.com/2012/01/android-api-quirks-getting-image-from.html
On Jan 8, 7:57 pm, John <droidxl...@gmail.com> wrote: > I can confirm having this same bug only with picasa images on > Honeycomb and ICS. > > Code: > > file = new File(getPath(intent.getData())); > > java.lang.RuntimeException: Failure delivering result > ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content:// > com.google.android.gallery3d.provider/picasa/item/ > 5685218575016337410 }} to activity {MyActivity}: > java.lang.NullPointerException > at android.app.ActivityThread.deliverResults(ActivityThread.java: > 2976) > at android.app.ActivityThread.handleSendResult(ActivityThread.java: > 3019) > at android.app.ActivityThread.access$1100(ActivityThread.java:122) > at android.app.ActivityThread$H.handleMessage(ActivityThread.java: > 1176) > at android.os.Handler.dispatchMessage(Handler.java:99) > at android.os.Looper.loop(Looper.java:137) > at android.app.ActivityThread.main(ActivityThread.java:4340) > at java.lang.reflect.Method.invokeNative(Native Method) > at java.lang.reflect.Method.invoke(Method.java:511) > at com.android.internal.os.ZygoteInit > $MethodAndArgsCaller.run(ZygoteInit.java:784) > at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) > at dalvik.system.NativeStart.main(Native Method) > Caused by: java.lang.NullPointerException > at java.io.File.fixSlashes(File.java:185) > at java.io.File.<init>(File.java:134) > at MyActivity.onActivityResult(MyActivity.java:184) > at android.app.Activity.dispatchActivityResult(Activity.java:4649) > at android.app.ActivityThread.deliverResults(ActivityThread.java: > 2972) > ... 11 more > java.lang.NullPointerException > at java.io.File.fixSlashes(File.java:185) > at java.io.File.<init>(File.java:134) > at MyActivity.onActivityResult(MyActivity.java:184) > at android.app.Activity.dispatchActivityResult(Activity.java:4649) > at android.app.ActivityThread.deliverResults(ActivityThread.java: > 2972) > at android.app.ActivityThread.handleSendResult(ActivityThread.java: > 3019) > at android.app.ActivityThread.access$1100(ActivityThread.java:122) > at android.app.ActivityThread$H.handleMessage(ActivityThread.java: > 1176) > at android.os.Handler.dispatchMessage(Handler.java:99) > at android.os.Looper.loop(Looper.java:137) > at android.app.ActivityThread.main(ActivityThread.java:4340) > at java.lang.reflect.Method.invokeNative(Native Method) > at java.lang.reflect.Method.invoke(Method.java:511) > at com.android.internal.os.ZygoteInit > $MethodAndArgsCaller.run(ZygoteInit.java:784) > at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) > at dalvik.system.NativeStart.main(Native Method) > > > > > > > > Andrew wrote: > > Hello, > > > I'm trying to launch a Gallery Intent to allow the user to select an > > image. The issue is that the code works on 2.x but fails occasionally > > on 4.x (I haven't tested 3.x). I've narrowed it down to issues > > specific to Picasa-sourced images. For example, from my google+ posts > > (still in the Gallery app). > > > The problematic URI is "content:// > > com.google.android.gallery3d.provider/picasa/item/<some ID>". > > Attempting to retrieve the image local path gives me the error : "W/ > > GalleryProvider( 8091): unsupported column: _data" > > > My code is below: > > > Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); > > photoPickerIntent.setType("image/*"); > > startActivityForResult(photoPickerIntent, PROFILE_PIC_RESULT); > > > and then in onActivityResult(int requestcode, int resultcode, Intent > > data) : > > > if(requestCode == PROFILE_PIC_RESULT && resultCode == RESULT_OK){ > > Uri selectedImage = data.getData(); > > String[] filePathColumn = {MediaStore.Images.Media.DATA}; > > Cursor cursor = getContentResolver().query(selectedImage, > > filePathColumn, null, null, null); > > cursor.moveToFirst(); > > > int columnIndex = > > cursor.getColumnIndexOrThrow(filePathColumn[0]); > > String filePath = cursor.getString(columnIndex); > > } > > > In 2.x, filePath will contain a useful string. In 4.x, filePath is > > null on some images because of the issue noted above. > > > I found a similar bug report that seems to be suffering from the above > > problem:http://code.google.com/p/android/issues/detail?id=21234 > > > Can anyone confirm? I might need to submit another bug report on this > > issue.. because it's frustrating that some images a user might pick > > will be invalid while others will be okay. -- 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