How to turn off wifi hotspot programmatically in Android 8.0 (Oreo) (setWifiApEnabled is not support this version anymore)
问题 I reference the code to turn on hotspot in Android 8.0, it is work. But I have no idea about how to disable it @RequiresApi(api = Build.VERSION_CODES.O) private void turnOnHotspot(){ WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); manager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback(){ @Override public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) { super.onStarted(reservation); Log.d(TAG, "Wifi