iPaulPro / aFileChooser

[DEPRECATED] Android library that provides a file explorer to let users select files on external storage.
Apache License 2.0
1.79k stars 850 forks source link

Added MIME type filter to FileChooserActivity and company. #38

Open alenz316 opened 10 years ago

alenz316 commented 10 years ago

Disables and grays out file entries that do not match the MIME type defined in the original intent type. FileUtils.compareMimeTypes from Android source code (ClipDescription.java).

alainpimentel commented 10 years ago

I have been looking in the library, but I can't a function that does this. Currently I hardcoded the type MIME_TYPE_VIDEO in FileUtils.createContentIntent(), but did you write a function that does this or is hardcoding the file type want the only way to do it?

This is a great library BTW!

alenz316 commented 10 years ago

Sorry for taking so long to respond. You should be able to just set the MIME type on the intent you use to launch the file chooser.

intent.setType(DESIRED_MIME_TYPE);
alainpimentel commented 10 years ago

Thank you for the answer. your library helped me a lot