简体   繁体   中英

Storage Access Framework not showing external storage device

I am currently using the storage access framework to allow my users to create/delete documents.

https://developer.android.com/guide/topics/providers/document-provider.html

Some of my users (a small percentage) are complaining though that their external storage device does not show up in the dialog screen.

I've already set the hidden EXTRA.

intent.putExtra("android.content.extra.SHOW_ADVANCED", true);

which is why my other users (the majority of them) can see the external storage. I am just wondering if there is some other EXTRA I need to set for the other users to see their external storage.

Edit:

Here's how I create the intent I use for the storage access framework.

private static final String MIME_TYPE = "*/*";
private static final String EXTRA_SHOW_ADVANCED = "android.content.extra.SHOW_ADVANCED";

private static Intent buildIntent() {
    final Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
    intent.addCategory(CATEGORY_OPENABLE);
    intent.setType(MIME_TYPE);
    intent.putExtra(EXTRA_LOCAL_ONLY, true);
    intent.putExtra(EXTRA_SHOW_ADVANCED, true);
    return intent;
}

Please don't rely on hidden constant values. This is a best effort stuff. Don't be surprised if it doesn't always work.

Vendors reserve their rights to modify Android code base, as long as their modifications don't break any CTS test, or GTS test if they would like to preload Google Service Framework. Hidden constants and API's usually are not protected by any CTS test so vendors might choose to remove them.

Google also reserves the right to remove any hidden API in future releases.

I'm not even getting internal storage, can you pinpoint the issue? My code is same as above but Show_Advanced is missing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM