GPS stays on using Intent call

I have a quick behavior question. When I call the following lines of code:

String currURL = "http://maps.google.com/maps?saddr="+nLocation.getLatitude()+","+nLocation.getLongitude()+"&daddr=110+Possum+Hollow+Road,+Newark,+DE+19711+(Tri-State+Bird+Rescue)&hl=en&ll=AnotherLat,AnotherLong&spn=0.28323,0.683212&sll=AnotherLat,AnotherLong&sspn=0.283147,0.683212&geocode=FcejYQIdRnCE-w%3BFXn_XQIda4F8-yF_tbhhHBmAIw&vpsrc=0&mra=pd&z=11";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(currURL));
App.this.getParent().startActivity(browserIntent);

It seems to keep the GPS on. Is there something wrong in what I was doing?

Thanks! Jon

Answers


If you requested location updates, then you must do removeUpdates(locationListener) So, right before doing startActivity, you might want to removeUpdates


If you are using an embedded MapView with a MyLocationOverlay, you need to explicitly clean up/disable this resource using MyLocationOverlay.disableMyLocation(), when your MapView closes. Because these individual overlays request for a location for themselves, and this can leave the GPS unit switched on, with the GPS icon flashing in the Status Bar.

Source: https://groups.google.com/d/msg/android-developers/SmiBz--6COc/blu9Bhkrt1QJ


Need Your Help

Geofencing UILocalNotification not working properly swift

ios swift notifications uilocalnotification

I am facing a strange problem with local notification in swift.

Can this Java singleton get rebuilt repeatedly in WebSphere 6?

java singleton instance

I'm trying to track down an issue in our system and the following code worries me. The following occurs in our doPost() method in the primary servlet (names have been changed to protect the guilty...