我在Manifest中有一个intent过滤器来处理url上的tap,如果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" android:host="*" port="8765" android:path="/mypath" />
</intent-filter>
当模式为“http”时,Intent过滤器工作,但如果我将其更改为“https”,则意图过滤器不会执行任何操作,并且链接开始在浏览器中加载.
有人知道这里有什么问题吗?
解决方法:
只需在过滤器中添加额外的数据行:
<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" android:host="*" port="8765" android:path="/mypath" />
<data android:scheme="https" android:host="*" port="8765" android:path="/mypath" />
</intent-filter>