Home  >  Q&A  >  body text

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>

怪我咯怪我咯2711 days ago481

reply all(1)I'll reply

  • 黄舟

    黄舟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>
    

    This is an example from the official Android documentation. You can try it.

    reply
    0
  • Cancelreply