我们都知道,目前在Android上编码实现打开或关闭飞行模式,都是直接调用android.provider.Setting.System.putString()接口实现的,代码如下:
......
// Enable airplane mode
Settings.System.putString(cr,Settings.System.AIRPLANE_MODE_ON, "1");
Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
sendBroadcast(intent);
// Disable airplane mode
Settings.System.putString(cr,Settings.System.AIRPLANE_MODE_ON, "0");
<