7

I have made custom scheme for my app by adding this to my activity in the android manifest:

 <activity android:name=".TabHostActivity"
              android:label="@string/app_name"
               android:configChanges="orientation|keyboardHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
         <intent-filter>
            <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.action.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.LAUNCHER" />
                 <data  android:scheme="myscheme" />
        </intent-filter>
    </activity>

When i write "myscheme://" i the android browser it opens my app (on some devices). The problem is that this is not working on the Samsung galaxy s and Xperia play. It only searches for myscheme:// on google.

Does anyone know whats wrong here?

Any help will be appreciated :)

Eli Barzilay
  • 29,301
  • 3
  • 67
  • 110
Zelleriation
  • 2,834
  • 1
  • 23
  • 23
  • Is this happening with the same browser on both working and not working devices (eg Chrome), or the stock browser on all devices? It sounds like the default browser for those devices just isn't doing what you expect it to. You can also try running `adb -d shell am start -d myscheme://something -a android.intent.action.VIEW` to ensure that the intent is being handled properly on the device when you aren't using the browser. – Bryan Herbst Mar 14 '13 at 21:31
  • I think nothing is wrong...you can verify as Tanis.7x said, or make a dummy web page with – Andrei Mar 15 '13 at 10:11
  • Can you try deleting the `LAUNCHER` category from the intent-filter which specifies your custom scheme and try again? I have used a custom scheme before and the only difference in the declaration is this one. Also the documents dictate that all the categories must be matched during the Intent resolution. – Plato Jun 22 '13 at 11:14

1 Answers1

1

It's common for browsers to search for a term or prepend "http://" in front of it if it's not already present. My guess is that's what's happening here.

If you create an HTML page with a link to myscheme://something, your app should show up in the chooser list.

Something like this: <a href="myscheme://it_worked"> click this link </a>

ggmathur
  • 833
  • 5
  • 12