I would like my application to launch when the user clicks on a link, for example, http://myapp.com
which is embedded in an SMS message.
I have followed this [solution] but it doesn't work for me. The emulator keeps opening the browser each time.
Here's the intent filter:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.catagory.DEFAULT"/>
<category android:name="android.intent.catagory.BROWSABLE"/>
<data android:host="myapp.com" android:scheme="http" />
</intent-filter>
I also tried to increase the priority of the intent filter in order to intercept the intent before the browser using the android:priority = 100
tag but it didn't change anything. So either this priority is not high enough or the intent filter didn't match from the beginning.
Here's the intent that the system broadcasts just after clicking on the link. It gave:
04-27 13:03:22.905: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.VIEW dat=http://myapp.com cmp=com.android.browser/.BrowserActivity}
My guess is that Android chooses the default browser each time this intent is sent out. I wonder if there is anything to do with the cmp attribute. Can we change it? Otherwise, how can we intercept the intent before the browser?
Any advices would be welcomed. Thank you in advance :)