android-multipicker-library icon indicating copy to clipboard operation
android-multipicker-library copied to clipboard

Unable to open content

Open softmarshmallow opened this issue 7 years ago • 4 comments


  imagePicker.setImagePickerCallback(new ImagePickerCallback()
                                                   {
                                                           @Override
                                                           public void onImagesChosen(List<ChosenImage> images) {
                                                                   // Display images
                                                                   ChosenImage chosenImage = images.get(0);
        
                                                                   Log.d(TAG, "onImageChosen image : " + chosenImage.getQueryUri());
                                                                   Log.d(TAG, "onImageChosen temp : " + chosenImage.getTempFile());
                                                                   
                                                                   menuMainPhotoImageView.setImageURI(
                                                                           Uri.fromFile(new File(chosenImage.getQueryUri())));
                                                                   
                                                           }
                        
                                                           @Override
                                                           public void onError(String message) {
                                                                   // Do error handling
                                                                   Log.e(TAG, message);
                                                           }
                                                   }
                );
                imagePicker.pickImage();


in Log


08-24 22:10:13.396 29176-29176/com.softmarshmallow.foodle D/MenuCreatorActivity: onImageChosen image : content://com.android.providers.media.documents/document/image%3A113
08-24 22:10:13.396 29176-29176/com.softmarshmallow.foodle D/MenuCreatorActivity: onImageChosen temp : 
08-24 22:10:13.397 29176-29176/com.softmarshmallow.foodle W/ImageView: Unable to open content: file:///content%3A/com.android.providers.media.documents/document/image%253A113
                                                                       java.io.FileNotFoundException: /content:/com.android.providers.media.documents/document/image%3A113 (No such file or directory)
                                                                           at java.io.FileInputStream.open0(Native Method)
                                                                           at java.io.FileInputStream.open(FileInputStream.java:200)
                                                                           at java.io.FileInputStream.<init>(FileInputStream.java:150)
                                                                           at java.io.FileInputStream.<init>(FileInputStream.java:103)
                                                                           at android.content.ContentResolver.openInputStream(ContentResolver.java:965)
                                                                           at android.widget.ImageView.getDrawableFromUri(ImageView.java:951)
                                                                           at android.widget.ImageView.resolveUri(ImageView.java:922)
                                                                           at android.widget.ImageView.setImageURI(ImageView.java:531)
                                                                           at android.support.v7.widget.AppCompatImageView.setImageURI(AppCompatImageView.java:124)
                                                                           at com.softmarshmallow.foodle.Views.StoreCreator.MenuCreatorActivity$1.onImagesChosen(MenuCreatorActivity.java:86)
                                                                           at com.kbeanie.multipicker.core.threads.ImageProcessorThread$1.run(ImageProcessorThread.java:52)
                                                                           at android.os.Handler.handleCallback(Handler.java:789)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                           at android.os.Looper.loop(Looper.java:164)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                                           at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
08-24 22:10:13.397 29176-29176/com.softmarshmallow.foodle W/ImageView: resolveUri failed on bad bitmap uri: file:///content%3A/com.android.providers.media.documents/document/image%253A113

how can i get the "Real" path to the file?? so i can load it to imageView or Get BitMap from it...

softmarshmallow avatar Aug 24 '17 13:08 softmarshmallow

Which application are you using to choose images?

coomar2841 avatar Aug 26 '17 19:08 coomar2841

sorry, i dont get what you mean by which application

softmarshmallow avatar Sep 10 '17 10:09 softmarshmallow

I've got the same error, but it seems that works perfectly on other phones

axvx avatar Jan 17 '18 16:01 axvx

Same Error here. Did you manage to solve this issue?

@axvx on what phones?

pedrohidalgo avatar Jun 27 '18 01:06 pedrohidalgo