GPS Icon stays in status bar after closing app that uses GeoClient() in webview
I'm using code similar to this one:
Using navigator.geolocation.getCurrentPosition in WebView on Android 2.0+ (PhoneGap related)
After closing the app, the GPS 开发者_如何学编程icon stays in the status bar and won't go away. Is there a way to fix this?
I had the same problem and this link solved the situation: How do I pause Flash content in an Android WebView when my activity isn't visible?
(the link discusses the problem with Flash plugin, but WebView's LocationListener obviously behaves the same way)
Basically, when your activity's onPause() is called, you need to call hidden (non-SDK) method onPause() of your WebView instance. Same way for onResume().
精彩评论