private void disableLocation() { myLocationOverlay.mLocationListener = null; // Update the screen to see changes take effect if (mapView instanceof View) { ((View) mapView).postInvalidate(); } }
private void enableLocation() { try { // force it to think it's own location listening is on myLocationOverlay.mLocationListener = new LocationListenerProxy(null); STATIC_LOCATION_LISTENER = myLocationOverlay; MainActivity.getListActivity(this).getGPSListener().setMapListener(myLocationOverlay); myLocationOverlay.enableMyLocation(); } catch (Exception ex) { ListActivity.error("Could not enableLocation for maps: " + ex, ex); } }