android - 三星手机忽略 Captive Portal Intent (android.net.conn.CAPTIVE_PORTAL)

标签 android intentfilter samsung-mobile captivenetwork captiveportal

我想设置一个可以选择用于导航强制门户的 Activity 。

当我选择一个强制 WiFi 网络时,我希望能够选择我的应用程序作为处理程序,而不是启动预装在每部 Android 手机上的 CaptivePortalLogin 应用程序。

这适用于 Pixel 2 和 OnePlus 6t,但不适用于我在这里放置的任何三星手机(S10 (9.0.0)、S8 (8.0.0)、A6 (8.0.0) )).在三星手机上,它会立即打开 CaptivePortalLogin 应用程序。

CaptivePortalLogin 应用未设置为三星手机上的默认应用。

我已经以标准方式设置了 Activity :

<activity android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>

        <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
    <intent-filter>
        <action android:name="android.net.conn.CAPTIVE_PORTAL"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</activity>

有没有办法让三星手机的行为与所有其他手机的行为一样?

最佳答案

三星通过将门户重定向到他们的系统来使用 android 强制门户机制,在内部处理它并阻止其他强制门户请求并在自己的浏览器上显示。 像三星一样,其他一些供应商(如华为等)也使用他们自己的机制,只有一些供应商(包括 Oneplus、Mi、Htc 和其他供应商)使用默认机制,因此可以使用门户 Intent 过滤器重定向到应用程序,但不能用于其他。

<intent-filter>
  <action android:name="android.net.conn.CAPTIVE_PORTAL"/>
  <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

这里有一个解释清楚的链接:

https://community.arubanetworks.com/t5/Wireless-Access/Samsung-Captive-Portal-Detection/m-p/405934#M78972

关于android - 三星手机忽略 Captive Portal Intent (android.net.conn.CAPTIVE_PORTAL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55341754/

相关文章:

android - 在 Android Studio 中为 Gradle 添加 AppCompat 依赖

android - Intent 过滤器浏览器 android :pathPrefix url parameter

Android:我可以以编程方式启用/禁用 Activity 的 Intent 过滤器吗?

android - 三星设备上的数据库错误

android - iPhone 和 Android 上的 Facebook 应用内浏览器不会在网站上提交表单

Android:如何删除内部图像文件

c# - 是否可以更改下方线条的颜色/文本框的边框(条目)

Android 应用仅为一个 Activity 启用 NFC

javascript - Async + ClickBusting + Cordova + Android Galaxy S4 = 意外退出

android - 标准 Seekbar 的进度条不出现