Why isn't Android's onProviderEnabled() method being called?

怎甘沉沦 提交于 2019-11-29 13:32:13

IMO, when you go to settings the onPause() is called and listeners are unregistered. Then you enable the GPS and return to your activity. So when you register the listeners the GPS is already enabled, so listener onProviderEnabled() is never called, since it is only called when GPS status is changed to enabled.

cgr

I had mLocationManager.removeUpdates(this) in onStop() which was getting called when I pulled down the Notification Tray to turn on the locations services. So though I turn on the locations, my onProviderEnabled() was not getting called. Thanks for the hint @Peter.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!