0

I want to turn off and on airplane mode in android without toggle button. this is my code. when the app reached this code airplane mode should on:

 if (intent.getAction().equals(strAirplaneOn)){

    }

and when the app reaches this code airplane mode should off:

else if (intent.getAction().equals(strAirplaneOff)){

    }
  • So, what's stopping you from doing that? What's your question? Did you try anything? – EJoshuaS - Stand with Ukraine Aug 02 '17 at 16:00
  • Possible duplicate of [How to programmatically enable and disable Flight mode on Android 4.2?](https://stackoverflow.com/questions/13766909/how-to-programmatically-enable-and-disable-flight-mode-on-android-4-2) – Bob Aug 02 '17 at 16:01
  • I tried many ways, like https://stackoverflow.com/questions/13766909/how-to-programmatically-enable-and-disable-flight-mode-on-android-4-2 – Aboli Aboli Aug 02 '17 at 16:02
  • And what happened when you tried them? What went wrong? Also, please see [this answer](https://stackoverflow.com/questions/25674655/how-to-turn-on-off-airplane-mode-even-on-new-android-versions-and-even-with-ro), it may not actually be possible on non-rooted devices anymore through "normal" APIs if I'm reading the answers correctly. – EJoshuaS - Stand with Ukraine Aug 02 '17 at 16:04
  • 2
    Possible duplicate of [How to turn on/off airplane mode, even on new Android versions (and even with root)?](https://stackoverflow.com/questions/25674655/how-to-turn-on-off-airplane-mode-even-on-new-android-versions-and-even-with-ro) – EJoshuaS - Stand with Ukraine Aug 02 '17 at 16:05
  • all stops app.. – Aboli Aboli Aug 02 '17 at 16:07
  • I can't use root access in my app – Aboli Aboli Aug 02 '17 at 16:09

0 Answers0