ホームページ  >  に質問  >  本文

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>

怪我咯怪我咯2712日前482

全員に返信(1)返信します

  • 黄舟

    黄舟2017-04-17 13:18:44

        <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官方文档的实例,题主可以试试。

    返事
    0
  • キャンセル返事