MaiaVictor
MaiaVictor

Reputation: 52977

Android intent not working to make app launcheable from browser

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?

Upvotes: 2

Views: 1116

Answers (1)

hBrent
hBrent

Reputation: 1716

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?

Upvotes: 1

Related Questions