Search code examples
androidandroid-intentintentfilter

Unable to launch app from web browser


I'm trying to launch my app as stated here: Launch custom android application from android browser
I've created intent-filter in my manifest:

<activity
            android:name=".ui.BaseActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop" 
            android:configChanges="orientation|keyboard|keyboardHidden|screenSize">
            <intent-filter>
                 <data android:scheme="http" android:host="somesite.com"/>
                 <action android:name="android.intent.action.VIEW"/>
                 <category android:name="android.intent.category.BROWSABLE" />
                 <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

But when I type in stock browser "somesite.com" - it loads "somesite.com" instead of launching my app. What's wrong?
P.S: this https://stackoverflow.com/a/13019256/1548085 doesn't help


Solution

  • Typing a link in the browser doesn't start an intent: the browser just browses to that URL. The intent mechanism is only used when you follow (i.e. click) a link in the browser.