我想制作一个涉及响应设备上所有 URL 的应用程序。文档提到了如何处理如下所示的特定方案 -
<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:host="www.youtube.com" android:scheme="http" />
</intent-filter>
但是如何定义 Intent 过滤器来处理不只属于特定域或主机的任何 URL?是否可以?
最佳答案
定义架构如下:
<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 android:scheme="https"/>
<data android:scheme="about"/>
<data android:scheme="javascript"/>
</intent-filter>
关于android - Android 中 Intent 过滤器响应所有 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37543004/