Android的回应网址意向意向、网址、Android

由网友(难捱)分享简介:我想我的意图来启动,当用户进入一个特定的URL:例如,在Android市场上的确有这个 HTTP://市场.android.com / 网址。这样做的YouTube。我想我的这样做了。I want my intent to be launched when the user goes to a certain url...

我想我的意图来启动,当用户进入一个特定的URL:例如,在Android市场上的确有这个 HTTP://市场.android.com / 网址。这样做的YouTube。我想我的这样做了。

I want my intent to be launched when the user goes to a certain url: for example, the android market does this with http://market.android.com/ urls. so does youtube. I want mine to do that too.

推荐答案

我做到了!使用<intent-filter>.把下面的内容清单文件:

I did it! Using <intent-filter>. Put the following into your manifest file:

<intent-filter>
  <action android:name="android.intent.action.VIEW"></action>
  <category android:name="android.intent.category.DEFAULT"></category>
  <category android:name="android.intent.category.BROWSABLE"></category>
  <data android:host="www.youtube.com" android:scheme="http"></data>
</intent-filter>

这完美的作品!

阅读全文

相关推荐

最新文章