I have an app that could view different kinds of video files using intent filters from different sources. To allow the app to appears always as choice when I try to open whatever video file, I have placed this code in the manifest
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.PICK"/>
<data android:mimeType="video/*" />
</intent-filter>
So I can receive the Uri in the app handling It in the main activity.
Although everything seems working as supposed, every time that I try to edit the manifest Android Studio marks all intent filter code with a red underline reporting the error missing url
.
The error disappears If I remove <data android:mimeType="video/*" />
but If I do this the app appears as choice not only for video files.
@AndreaF I have tha same issue. You can just suppress this warning.
To suppress try this:
<intent-filter tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.PICK"/>
<data android:mimeType="video/*" />
</intent-filter>
add xmlns:tools="http://schemas.android.com/tools" to your initial manifest tag if it's not already there.
Prompt missing url not because action.PICK
, the error related to action.VIEW
<intent-filter>
<action android:name="android.intent.action.VIEW"/> //delete this line
<action android:name="android.intent.action.PICK"/>
<category android:name="android.intent.category.DEFAULT"/> //add this line
<category android:name="android.intent.category.OPENABLE"/> //and this
<data android:mimeType="video/*" />
</intent-filter>
for action.VIEW
,you could define a different intent-filter.