[Xamarin.Android.Tools.AndroidSdk] Check all <intent-filter/>s #214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: https://developercommunity.visualstudio.com/t/Cannot-deploy-to-Android-emulators-and-d/10428163
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1863835
Context: https://developer.android.com/guide/components/intents-filters
The
<activity/>and related elements withinAndroidManifest.xmlcan have multiple<intent-filter/>s specified. Android does not require that<intent-filter/>s be listed in any particular order.However, Visual Studio does care about the order (?!)!
If the
[IntentFilter]withAndroid.Content.Intent.ActionMainis not first, then Visual Studio does not consider this Activity to be a launchable activity.The reason for this is, in part, because
AndroidAppManifest.GetLaunchableActivities()only looked at the first<intent-filter/>to see if it had the category ofandroid.intent.category.LAUNCHER.Update
AndroidAppManifest.GetLaunchableActivities()so that all<intent-filter/>elements are checked for the.LAUNCHERcategory.Workaround: Specify the
[IntentFilter]withIntent.ActionMainfirst:Note: this change, in and of itself, may not be sufficient to fix Visual Studio, as there are a few other places that have the same "only check the first
<intent-filter/>" bug.