Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

IntentFilter attribute ignored?

PhilippSumiPhilippSumi USMember ✭✭✭

Hi all

I'm trying to register my app for certain URLs, and have the following filter, which seems to be ignored:

[Activity(Label = "xxx", Name = "foo.bar.ShortCode" ...]
[
IntentFilter
(
    new[] { Intent.ActionView },
    Categories = new[]
    {
            Intent.CategoryDefault,
            Intent.CategoryBrowsable
    },
    DataScheme = "http",
    DataHost = "www.ridr.me"
)
]
public class ShortCodeListener : Activity { ... }

Weird enough, if I add the same specification to the manifest manually, the activity is being invoked if a URL that matches the pattern is clicked:

    <activity android:name="foo.bar.ShortCode">
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http" android:host="www.ridr.me" />
        </intent-filter>
    </activity>

Any idea what I'm missing?
(btw, I already tried adding the AutoVerify flag to the attribute, that didn't change anything)

Sign In or Register to comment.