1

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?

Community
  • 1
  • 1
Basher
  • 46
  • 6

1 Answers1

0

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().

Community
  • 1
  • 1
Pavel P
  • 637
  • 1
  • 7
  • 21