title: trouble using Airplane Mode on Android
body: <p>I have troube to use Airplane mode on my app. The app runs perfectly well on my emulator but not in my real phone when I try my apk.</p>
  
  <p>Here is the code to activate the Airplane : </p>
  
  <pre><code>Settings.System.putInt(getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 1);
          // Post an intent to reload
          Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
          // send a broadcast
          //intent.putExtra("state", !isEnabled);
          intent.putExtra("state", true);
          sendBroadcast(intent);
  </code></pre>
  
  <p>To desactivate it :</p>
  
  <pre><code>Settings.System.putInt(getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0);
          // Post an intent to reload
          Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
          // send a broadcast
          intent.putExtra("state", false);
          sendBroadcast(intent);
  </code></pre>
  
  <p>I read that I cannot create the intent (<a href="http://developer.android.com/reference/android/content/Intent.html#ACTION_AIRPLANE_MODE_CHANGED" rel="nofollow">android doc</a>) but I saw people that could make airplane mode so I don't understand!</p>
  
  <p>Thanks to help me !</p>