Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ACTION_OPEN_DOCUMENT not working on MIUI

Tags:

android

I want to use ACTION_OPEN_DOCUMENT on my Xiaomi Device. I tried this google sample, but it also not working. With code below i can normally run on Samsung galaxy s4.

Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
                startActivityForResult(intent, 42);

Im getting "android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT_TREE }" error.

like image 601
Kostya1375 Avatar asked Dec 01 '15 12:12

Kostya1375


1 Answers

Xiaomi screwed up, apparently. AFAIK, they're not Google Play certified, so they do not need to pass the CTS. There is nothing you can really do about it, other than to detect this case (e.g., use PackageManager and queryIntentActivities(), or catch the ActivityNotFoundException) and fall back to whatever you do on pre-Android 4.4 devices.

like image 156
CommonsWare Avatar answered Oct 29 '22 19:10

CommonsWare