Android: "Element intent-filter is not allowed here" inside <provider>? -


at http://developer.android.com/guide/topics/providers/document-provider.html#manifest shown how register custom document provider in manifest:

<manifest... >     ...     <uses-sdk         android:minsdkversion="19"         android:targetsdkversion="19" />         ....         <provider             android:name="com.example.android.storageprovider.mycloudprovider"             android:authorities="com.example.android.storageprovider.documents"             android:granturipermissions="true"             android:exported="true"             android:permission="android.permission.manage_documents"             android:enabled="@bool/atleastkitkat">             <intent-filter>                 <action android:name="android.content.action.documents_provider" />             </intent-filter>         </provider>     </application>  </manifest> 

this <intent-filter> element necessary here, android studio complains with:

element intent-filter not allowed here

and the documentation provider element seems indicate well:

can contain: <meta-data>  <grant-uri-permission>  <path-permission> 

is android studio , documentation bug or missing something?

you're not missing anything; android studio , documentation incorrect. providers subject discovery through intent matching, other component.

android finds document providers using code this:

intent = new intent(documentscontract.provider_interface);

list<resolveinfo> providers = packagemanager.queryintentcontentproviders(i, 0);


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -