配置文件如下:
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="ndroid.permission.ACCESS_WIFI_STATE"></uses-permission>
wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);