Android 4.4 KitKat - How can I avoid the new file picker?

Viewed 1462

I have an application which needs to ask the user for a file. I achieve it by starting an activity using an intent with Intent.ACTION_GET_CONTENT action and "file/*" MIME type.

It works fine on earlier android versions than 4.4. System shows the list of installed file managers, and my app gets a "file://" URL after I choose a file.

The problem comes when I run the app on KitKat. When the app wants to open a file on KitKat, the new built-in file picker shows up. It lists various sources to open a file, such as "Downloads", etc. But all files are greyed out. I can't open them. Ok, when I change MIME type to "*/*", it lets me open the same files. Then I open a file, and my application receives a "content://" style URL as result.

I know how to read data from those URLs, but it would be hard to rewrite the whole app to support it. It's a large one and was intended to work with files.

Is there any way to strictly define in the Intent that I want a "file://" url?

Or is there a way to prevent KitKat from using the new file picker framework? Is there any way to have it working in the same way as on earlier versions?

Can this problem be solved without implementing "content://"-style URL support in the app? Probably it would be the clearest solution...

Thanks in advance!

0 Answers
Related