coomar2841 / image-chooser-library

An Easy Image/Video Chooser Library for your Android Apps
646 stars 193 forks source link

Cannot choose image or video on lollipop (REQUEST_PICK_PICTURE_OR_VIDEO) #94

Open tplkn opened 9 years ago

tplkn commented 9 years ago

Base code is

this.mediaChooserManager = new MediaChooserManager(this, ChooserType.REQUEST_PICK_PICTURE_OR_VIDEO);
 this.mediaChooserManager.setMediaChooserListener(this);

and

mediaChooserManager.choose();

it works on 4.4, but doesn't work on lollipop.

coomar2841 commented 9 years ago

It doesn't show anything at all? Or you are not able to choose images/videos? I haven't tested this out yet on lollipop, especially PICK_PICTURE_OR_VIDEO. Will check it out, and update this issue.

tplkn commented 9 years ago

I'm not able to choose images, i can choose only videos

hjanuschka commented 9 years ago

same here on lolipop actionbar title is "Choose Video" - even if PICK_PICTURE_OR_VIDEO is set. and only lets me select videos. only when using the built-in "photos" app. using another gallery app, works as expected.

hjanuschka commented 9 years ago

possible solution - as found on SO. in https://github.com/coomar2841/image-chooser-library/blob/dev/image-chooser-library/src/main/java/com/kbeanie/imagechooser/api/MediaChooserManager.java#L180

you should use / instead of images/, videos/*

sample

if (Build.VERSION.SDK_INT < 19) {
        Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); 
        photoPickerIntent.setType("image/* video/*");
        startActivityForResult(photoPickerIntent,REQUEST_CODE_GALLERY_FILES);
   } else {
        Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);
        photoPickerIntent.setType("*/*");
        startActivityForResult(photoPickerIntent, REQUEST_CODE_GALLERY_FILES);
   }

SO thread: http://stackoverflow.com/questions/32375385/android-pick-video-files-from-gallery-not-working-in-nexus-5

can you fix it? and relase a new version, not sure how to fork repo, and integrate into my gradle (pretty new to android)

macdonaldj commented 8 years ago

still an issue in 1.6