在清单中
在您的类文件中执行以下操作
public class BootTimeServiceStarter extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();
if (bluetooth.getState() == BluetoothAdapter.STATE_ON
|| bluetooth.getState() == BluetoothAdapter.STATE_TURNING_ON) {
bluetooth.disable();
}
WifiManager wifiManager = (WifiManager) context
.getSystemService(Context.WIFI_SERVICE);
if (wifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLED
|| wifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLING) {
wifiManager.setWifiEnabled(false);
}
}
}