http://developer.android.com/guide/topics/providers/document-provider.html状态:
ACTION_OPEN_DOCUMENT is not intended to be a replacement for ACTION_GET_CONTENT.
The one you should use depends on the needs of your app:
Use ACTION_GET_CONTENT if you want your app to simply read/import data.
With this approach, the app imports a copy of the data, such as an image file.
Use ACTION_OPEN_DOCUMENT if you want your app to have long term, persistent access
to documents owned by a document provider. An example would be a
photo-editing app that lets users edit images stored in a document provider.
这表明大多数提供文件的应用程序应该支持这两种意图类型。
但是,当应用程序同时支持ACTION_GET_CONTENT
(通过在其意图过滤器中具有匹配的活动)和ACTION_OPEN_DOCUMENT
(通过实现文档提供程序)时,它会在例如将文件附加到 Gmail 时显示两次。这是由于文件选择 UI 显示了文档提供者和ACTION_GET_CONTENT
匹配器(后者显示在分隔线下方的下方)。
是否可以避免重复显示应用程序以避免混淆用户?
有关问题的示例,请参见下面的屏幕截图和两次显示的 Box 条目: