Question

I have following intent filter:

        <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="myghost.com"
                android:pathPattern=".*\.html"
                android:scheme="http" />
        </intent-filter>

It works fine in most cases, but when I open links containing "shadow" and "high" chooser is not called.

Anyone knows other magic words that work in same manner>

Is there a possibility to disable such behavior?

Was it helpful?

Solution

Issue is related to escaping '.' character.

Change android:pathPattern=".*\.html" to android:pathPattern=".*\\.html"

'\' is used as escape character when the string is read from XML. You will need to double-escape it i.e. literal '.' would be '\\.'

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top