Which Activity Life Cycle Gets Called When App Redirect To Settings
In my application, I am calling gps setting menu if gps is not enabled. I called this in Oncreate() method. However, I also wants to check whether user actually enables it or not?
Solution 1:
A good way to find out is using the build in caller methods triggered, when one event like on pause() is called, then you log the name of the event, and voila then you know which class is triggered to which time.
Solution 2:
As far as I know the only reliable way is setup and listen to the gps changes via listener (GpsStatus.Listener) - LocationManager#addGpsStatusListener(...). In the onGpsStatusChanged method you can react to GpsStatus#GPS_EVENT_STARTED or GpsStatus#GPS_EVENT_STOPPED and change the update of your UI via Handler. Hope this helps :-)
Post a Comment for "Which Activity Life Cycle Gets Called When App Redirect To Settings"