Y
Y
Yaroslav2014-06-03 23:28:53
Android
Yaroslav, 2014-06-03 23:28:53

Launching my application from a browser on a click on a link?

I wanted to catch clicks on the pages of my site in the browser and show the activity at the same time. I have a test page on my site kciray.com/test.html that has links.
Did it like this:

<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:pathPrefix="/index.php"
                    android:host="kciray.com" />
</intent-filter>

Logically, when you click on kciray.com/index.php , my activity should be called. But the browser is trying to just follow the link as usual. Nothing happens. Tried in Dolphin and UC - doesn't work anywhere! What's the matter? The example from the book should work. The long stackoverflow trip didn't help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Yakushev, 2014-06-04
@kciray

<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:host="kciray.com" android:scheme="http" android:pathPattern=".*" />
  <data android:host="www.kciray.com" android:scheme="http" android:pathPattern=".*" />
</intent-filter>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question