2

I'm trying to achieve this using the following code:

    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
         <intent-filter>
            <data android:scheme="ttest" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

Clicking 'debug' on Eclipse will launch my app correctly. But going to the browser and typing 'ttest://foo' won't launch the app as expected. What's wrong?

MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
  • If you add `android:host="*"` to the `data` tag, does that solve the issue? – Cat Oct 21 '12 at 20:18
  • @Eric it does not work... when I type "ttest://foo" on the Android browser, it goes to google search, even after (I think) installing the app with that intent-filter, by clicking debug on Eclipse. – MaiaVictor Oct 21 '12 at 20:35

1 Answers1

1

I did some tests on an HTC Sensation running ICS, a Samsung running 2.3.3, and a 4.0.3 emulator. I couldn't get any URL intent handling to work on the HTC, but had no trouble with the Samsung or the emulator. Any chance you're using an HTC phone? Apparently HTCs have a problem with this: Standard intent URI broken?

Community
  • 1
  • 1
hBrent
  • 1,696
  • 1
  • 17
  • 38