Question

I am trying to use an intent filter to open my activity if a certain URL is opened, whether from a scanned QR code, a link in an email or from browsing to the site from Chrome or the browser. Here is a snippet from my Manifest:

 <activity
        android:name="com.openapp.projecttest.Main"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter> 
        <intent-filter>
            <action android:name="android.intent.action.VIEW"></action>
            <category android:name="android.intent.category.DEFAULT"></category>
            <category android:name="android.intent.category.BROWSABLE"></category>
            <data android:host="www.qwert.com" android:scheme="http"></data> 
        </intent-filter> 
    </activity>

When I browse to it on Google Chrome, it does not seem to trigger the intent filter. Am I missing a permission?

Was it helpful?

Solution

It does work from a link, but does not work if browsed to the URL through the browser.

OTHER TIPS

It should work through a browser link if you include the pathPattern in your data filter.

android:pathPattern="/path/pattern"

where you fill in the path and pattern, of course.

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