Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须做点什么。就在启用Wi-Fi的时候,我调用了method WifiManager.setWifiEnabled(),当方法返回时,Wi-Fi状态会同时改变吗?如果没有,如何追踪 Wi-Fi 状态的变化?
WifiManager.setWifiEnabled()
setWifiEnabled aparents 是异步的,正如我在测试时看到的那样,所以我认为唯一的选择是让代码等待几秒钟,再试一次等等