0

Im trying to register a protocol in my app whereby a url executed in the android browser will launch my activity, all the examples Ive seen on the web say to add an Intent Filter on my activity such as

<activity android:name=".UrlActivity">

<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:scheme="myscheme" android:host="myhost"/> 
</intent-filter>
</activity>`

but this doesnt seem to be enough to get the Android OS to launch my activity... Is there anyone who could tell me if there is something Im missing?

Thanks

TNM
  • 11
  • 1
  • 2

2 Answers2

0

The URL has to be made available as a hyperlink on a page for the user to tap. Entering the URL in a browser on your device will not work. This resolved the problem for me.

Ken
  • 30,811
  • 34
  • 116
  • 155
0

Try removing theandroid:host part, but retain the android:scheme attribute.

Also check logcat for any errors or warnings.

Dave
  • 6,064
  • 4
  • 31
  • 38
  • thanks for your reply, i have tried that,there's got to be something wrong with my setup,im also debugging on a phone running 2.2 as i constantly have problems with the emulator – TNM Aug 21 '11 at 14:18