编译错误
Error:Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing to .getApplicationContext() [WifiManagerLeak]
把
WifiManager wifiManager = (WifiManager)getSystemService(WIFI_SERVICE);
修改成
WifiManager wifiManager = (WifiManager)getApplicationContext().getSystemService(WIFI_SERVICE);