View in Telegram
南宫雪珊
实现DocumentsProvider#isChildDocument(String, String)是支持Intent#ACTION_OPEN_DOCUMENT_TREE的必要条件,DocumentsContract.Root#FLAG_SUPPORTS_IS_CHILD 用于声明该方法是否实现。可惜这个flag只有少数DocumentsProvider拥有,Google自家的云端硬盘也没有。
https://developer.android.com/guide/topics/providers/create-document-provider
这个flag不普及的原因可能因为示例代码没有它,示例只包括如何支持 ACTION_OPEN_DOCUMENT,虽然只需要再多一个方法就能让SAF访问从打开单个文件升级到打开一个文件夹,使用场景大幅增加。
Android Developers
Create a custom document provider | Android Developers
Android 4.4 (API level 19) introduces the Storage Access Framework (SAF). The SAF makes it simple for users to browse and open documents, images, and other files across all of their their preferred document storage providers.
Share
Love Center - Dating, Friends & Matches, NY, LA, Dubai, Global
Find friends or serious relationships easily
Start