4

I have implemented the code for the URL Scheme as shown below in manifest.xml. this code is not working for any browser.

<activity
        android:name=".Event"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Black.NoTitleBar"
        android:windowSoftInputMode="adjustPan|stateAlwaysVisible" >
        <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="http" android:host="xyz" />
        </intent-filter>
    </activity>

The below code is working only for default browser.

<activity
        android:name=".Event"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Black.NoTitleBar"
        android:windowSoftInputMode="adjustPan|stateAlwaysVisible" >
        <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="xyz"  />
        </intent-filter>
    </activity>

so, please give me the solution to work custom URL Scheme with any browser or what i have to change in above code for this problem.

itsbruce
  • 4,825
  • 26
  • 35
dilipkaklotar
  • 1,469
  • 3
  • 20
  • 28
  • 1
    Are you sure it is not the other way around. the first code works, the second doesnt? Refer to my question http://stackoverflow.com/q/13042278/1503155 , I think we have the same problem. – Lazy Ninja Oct 24 '12 at 07:04

1 Answers1

2

To first code: adding android:pathPattern=".*" should fix it for http scheme.

To second code: for Chrome you have to use intent: syntax. Chrome does not listen to custom schemes (any more).

Jeans Bond
  • 21
  • 3
  • Jean could you elaborate on your second point - i can't get my app to launch from any browser at all - – Tom Jun 17 '16 at 13:43