微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – 在intent-filter中处理https架构

我在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>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐