Android,how to disable confirm dialog when open wifi by code -
When I open WIFI by code like this:
Wifi Manager Wifim = (WifiManager) reference .getSystemService (Context.WIFI_SERVICE); Wifim.setWifiEnabled (true); It woks but the Android system opens itself a confirmation dialog like this:
Warning Apple WifiOpenTest is trying to True on your WLAN connection. Do you want to allow this? Allow What I want to ask is I can open WIFI in the source without showing this dialog Thanks.
You need to add the following to your manifest
Lt; Use-permission Android: name = "android.permission.ACCESS_WIFI_STATE" & gt; & Lt; / Usage-permission & gt; & Lt; Usage-permission Android: name = "android.permission.CHANGE_WIFI_STATE" & gt; & Lt; / Usage-permission & gt;
Comments
Post a Comment