devworkstation
devworkstation

Reputation: 147

Catch browser starting in a Service Android

Is it possible to catch when the link was clicked in Android Service. I do know that it is impossible to catch onTouch Event in the service. But maybe WebBrowser starting is possible?. Please help! Very Important. I need to start my Web Based app when the specific link was clicked.

Upvotes: 0

Views: 176

Answers (1)

FunkTheMonk
FunkTheMonk

Reputation: 10938

An activity can be registered to be started using a url, which you define in your manifest

<activity android:name=".YourActivity">
            <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="yourscheme" />
            </intent-filter>
        </activity>

Your activity will then be launched if a link looking like yourscheme://something is clicked

Upvotes: 1

Related Questions