fix issue 132

git-svn-id: https://osmand.googlecode.com/svn/trunk@705 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-11-25 09:52:57 +00:00
parent 473ae05c6d
commit 56a5bb4364
2 changed files with 8 additions and 2 deletions

View file

@ -54,8 +54,14 @@ public class NavigationService extends Service implements LocationListener {
public void run() {
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
if(register){
boolean continuous = serviceOffInterval == 0;
if(continuous){
serviceOffInterval = OsmandSettings.getSavingTrackInterval(OsmandSettings.getPrefs(NavigationService.this)) * 1000;
}
locationManager.requestLocationUpdates(serviceOffProvider, serviceOffInterval, 0, NavigationService.this);
delayedAction(false, serviceError);
if(!continuous){
delayedAction(false, serviceError);
}
} else {
locationManager.removeUpdates(NavigationService.this);
delayedAction(true, serviceOffInterval);

View file

@ -221,7 +221,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
saveTrackInterval.setEntryValues(new String[]{"1", "2", "5", "15", "30", "60", "300"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
saveTrackInterval.setValue(OsmandSettings.getSavingTrackInterval(prefs)+""); //$NON-NLS-1$
String[] ints = new String[]{"1", "2", "5", "8", "10", "15", "20", "25", "30", "40", "45", "60", "90" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$
String[] ints = new String[]{"0", "1", "2", "5", "8", "10", "15", "20", "25", "30", "40", "45", "60", "90" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$
String[] intDescriptions = new String[ints.length];
for(int i=0; i<intDescriptions.length; i++){
intDescriptions[i] = ints[i] + " " + getString(R.string.int_min); //$NON-NLS-1$