Fix error

This commit is contained in:
Victor Shcherb 2015-06-12 00:34:27 +02:00
parent 57570ff78a
commit cf4d383b58
2 changed files with 5 additions and 3 deletions

View file

@ -356,11 +356,14 @@ public class FavouritesDbHelper {
fld.mkdirs();
}
int back = 1;
DecimalFormat formatter = new DecimalFormat("00");
String backPrefix = "" + back;
if(back < 10) {
backPrefix = "0"+backPrefix;
}
File firstModified = null;
long firstModifiedMin = System.currentTimeMillis();
while(back <= BACKUP_CNT) {
File bak = new File(fld, "favourites_bak_" + formatter.format(back) +".gpx.bz2");
File bak = new File(fld, "favourites_bak_" + backPrefix +".gpx.bz2");
if (!bak.exists()) {
return bak;
} else if (bak.lastModified() < firstModifiedMin) {

View file

@ -176,7 +176,6 @@ public class NavigationService extends Service implements LocationListener {
if(plugin.getTracker().isEnabledTracker()) {
plugin.getTracker().disableTracker();
}
plugin.getService().disconnect();
}
NavigationService.this.stopSelf();
}