How do I start an activity from a browser in Android?

How do I start my activity from the Android browser?

I have a link that says, http://a.b.com. When the user enters the URL in the Android browser, I need to open the activity. There are the following intent filters in my android list:

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
    <data android:scheme="http" android:host="a.b.com"/>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT"/>  
    <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>

resolvent:

Look at how to register some URL namespace( myapp://app.start/ ) for accessing your program by calling a URL in browser in Android OS?

(don't get stuck in the title of the question. The answer is relevant.)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>