本文介绍了如何检查编程是否热点已启用或禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  如何检测的WiFi网络共享状态

我需要检查,如果热点是或不是我的设备上通过我的应用程序?

I need to check if hotspot is on or not on my device through my app?

推荐答案

code:

Method method = wifiManager.getClass().getDeclaredMethod("getWifiApState");
method.setAccessible(true);
int actualState = (Integer) method.invoke(wifiManager, (Object[]) null);

实际状态应该是:

the actual state should be:

public static int AP_STATE_DISABLING = 10;
public static int AP_STATE_DISABLED = 11;
public static int AP_STATE_ENABLING = 12;
public static int AP_STATE_ENABLED = 13;
public static int AP_STATE_FAILED = 14;

WifiManger源$ C ​​$ C

希望,这可能是帮助你!

hope this might be help you!

这篇关于如何检查编程是否热点已启用或禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 18:01
查看更多