coomar2841 / image-chooser-library

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

Choose image from Highlights doesn't work #15

Closed ethan-fang closed 10 years ago

ethan-fang commented 10 years ago

In Android 4.1, when selecting photo from

"Photos"->"Highlights", which is the google plus app, the image can not be retrieved.

coomar2841 commented 10 years ago

Will fix it for the next release.

coomar2841 commented 10 years ago

Struggling with this. :) Although the fix that I am working on works for images now, it doesn't work for videos. Any pointers?

fheft commented 10 years ago

Struggling with this as well for quite a few days now, but I only need it for images… could you please commit your fix for images (or provide a patch file) for further investigation?

coomar2841 commented 10 years ago

You can checkout the dev branch to see if it works fine for images. It has a few quirks. Has a tendency to stall the UI when you choose a non-cached image.

fheft commented 10 years ago

I was using the dev branch but in this case it seems to not work for me at all. The changes are in commit 6217a571ea1acccd389c92b345588c6efc39f0e9 I guess (it's the only one related to the Google Photo App)?

coomar2841 commented 10 years ago

Yes. That are the changes. By "Not working at all", do you get a crash or an error message?

coomar2841 commented 10 years ago

Sorry. The changes are on the dev_get_content branch. Please try that once and see. BTW, there's a sample project inside the library which you can directly use.

coomar2841 commented 10 years ago

I think I have solved the problem. Would update this after a bit more testing.

fheft commented 10 years ago

Sadly I did not have much time to look into the issue but the dev_get_content branch seems to work for photos from the "Highlights" tab. But I had to revert the intent type from 'ACTION_GET_CONTENT' back to 'ACTION_PICK' (065a0d3170aa811d558f3c25273d12b20da98b99), otherwise it would open the Android 4.4 image chooser which seems to break everything. But I could not investigate this further, it was just a quick way to test selection from "Highlights". Thanks for your efforts!

coomar2841 commented 10 years ago

Android 4.4 image chooser? Is that the default on 4.4? I will do a check on the emulator. Don't have a 4.4 device yet.

fheft commented 10 years ago

I just updated the library and tried it. If I try to select an image, the KitKat image chooser opens immediately with the "Latest" tab (showing your latest photos). Selecting one of them will fail, because the content uri is something like content://com.android.providers.media.documents/document/image%3A8537. But according to StackOverflow the fix should be rather easy – I'll have a look this evening!

coomar2841 commented 10 years ago

Thanks for that. Will add a fix for Kitkat.

fheft commented 10 years ago

Great! It seems to work for me now (with a quick&dirty implementation of the stackoverflow fix). I am not using your library in a published app yet but I'm very positive that it will improve the whole image selection nightmare - thanks a lot for that!

coomar2841 commented 10 years ago

I have pushed a simple fix for KITKAT. Could you give it a try? It's still on dev_get_content (Uses GET_CONTENT) intent. Thanks :)

hidabe commented 10 years ago

I have tried it in kitkat, it work

coomar2841 commented 10 years ago

Closing this now.