static boolean isAirplaneModeOn(Context context) { 
        return Settings.System.getInt(context.getContentResolver(),
              Settings.System.AIRPLANE_MODE_ON, 0) != 0; 
    } 
这是Settings中取得飞行模式的代码

解决方案 »

  1.   

    http://www.blogjava.net/anymobile/articles/301328.html参考一下吧
      

  2.   

    设置完要发个intent通知下,不然不会立即生效
      

  3.   

    参看AirplaneModeEnabler.java 类
      

  4.   

    设置飞行模式值;//1为开启,0为关闭
    Settings.System.putInt(mContext.getContentResolver(),Settings.System.AIRPLANE_MODE_ON, enabling ? 1 : 0);//这段代码可以跳转到打开飞行模式那一个页面,看你用的上不
    Intent mIntent = new Intent("/");
    ComponentName comp = new ComponentName("com.android.settings",
    "com.android.settings.WirelessSettings");
    mIntent.setComponent(comp);
    mIntent.setAction("<span class=\"hilite\">android</span>.intent.action.VIEW");
    startActivity(mIntent);