How to detect if user selects airplane mode panel and show its setting at any time?

45
December 06, 2018, at 5:40 PM

In my app's MainActivity I want to check if a user selects the airplane-mode panel and changes the airplane-mode to on/off. The MainActivity shows in onCreate the appropriate network connection and should update its settings after the user invoked the airplane-mode panel.

I tried using the onPause/onResume method in the hope to use them to determine whether my MainActivity/app is becoming active, has focus or is the (active) foreground process. Searching here I noticed quite some discussions related to figuring out if your app is in the foreground/active. I tried using one of onPause/onResume, timers, ActivityLifecycleCallbacks without success yet. Anybody know of a better solution for letting my MainActivity determine at any time the network-status/airplane-mode setting?

READ ALSO
Android app SHA-1 authentication fail firebase

Android app SHA-1 authentication fail firebase

My friend and I created an app and uploaded the APK on google play storeSome of our friends downloaded the app to try it, but they weren't able to register (using firebase number and/or email login)

8
Activities back stack seems to be lost

Activities back stack seems to be lost

I have 2 activities: A and B In B, I have a back arrow to go back to A by calling "finish()" methodIt works fine, except when the following is done:

45