首页 > android浏览器的intent-filter怎么设置

android浏览器的intent-filter怎么设置

手机检测到一个含有URL的NFC标签时,会提示选择一个浏览器来打开,下图。intent-filter应该怎么写,才会让系统提示中出现我自己写的程序呢,

下面这么写貌似没用,提示的只有浏览器,

<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"></data>
    <data android:scheme="https"></data>
</intent-filter>


    <intent-filter>
        <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
        <category android:name="android.intent.category.DEFAULT"/>
       <data android:scheme="http"
                  android:host="developer.android.com"
                  android:pathPrefix="/index.html" />
    </intent-filter>

这是Android官方文档的实例,题主可以试试。

【热门文章】
【热门文章】