When using an IntentFilter to allow my app to handle videos, the rendered AndroidManifest file contains empty elements for each of the values provided for DataSchemes and DataMimeTypes.
Is this a bug or is there something incorrect in the IntentFilter?
[Activity(... etc ...)] [IntentFilter( new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataHost = "*", DataSchemes = new string[] { "http", "https", "content", "file" }, DataMimeTypes = new string[] { "application/octet-stream", "video/mpeg4", "video/mp4", "video/3gp", "video/3gpp", "video/3gpp2", "video/webm", "video/avi", "application/sdp", "*/*", } )] public class MainActivity : FormsApplicationActivity {...}
AndroidManifest.xml renders intent-filter as:
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="*" /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> <data /> </intent-filter>
Using Xamarin.Forms v2.1.0.6529.
Can anyone recommend a fix or workaround, perhaps by manually adding to template AndroidManifest.xml?
For anyone else experiencing the same problem, the issue will be fixed in the Cycle 7 release.
Answers
I've reported a bug on this with a couple workarounds:
https://bugzilla.xamarin.com/show_bug.cgi?id=40059
For anyone else experiencing the same problem, the issue will be fixed in the Cycle 7 release.