Fix #2479
This commit is contained in:
parent
a2f3bc8495
commit
6e5aa43e5b
1 changed files with 17 additions and 3 deletions
|
@ -17,6 +17,7 @@ import android.widget.LinearLayout.LayoutParams;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.ValueHolder;
|
import net.osmand.ValueHolder;
|
||||||
import net.osmand.plus.ApplicationMode;
|
import net.osmand.plus.ApplicationMode;
|
||||||
|
@ -331,19 +332,32 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
||||||
app.getTaskManager().runInBackground(new OsmAndTaskRunnable<Void, Void, Void>() {
|
app.getTaskManager().runInBackground(new OsmAndTaskRunnable<Void, Void, Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params) {
|
protected void onPreExecute() {
|
||||||
isSaving = true;
|
isSaving = true;
|
||||||
|
if (monitoringControl != null) {
|
||||||
|
monitoringControl.updateInfo(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Void doInBackground(Void... params) {
|
||||||
try {
|
try {
|
||||||
SavingTrackHelper helper = app.getSavingTrackHelper();
|
SavingTrackHelper helper = app.getSavingTrackHelper();
|
||||||
helper.saveDataToGpx(app.getAppCustomization().getTracksDir());
|
helper.saveDataToGpx(app.getAppCustomization().getTracksDir());
|
||||||
helper.close();
|
helper.close();
|
||||||
app.getNotificationHelper().showNotification();
|
|
||||||
} finally {
|
} finally {
|
||||||
isSaving = false;
|
app.getNotificationHelper().showNotification();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(Void aVoid) {
|
||||||
|
isSaving = false;
|
||||||
|
if (monitoringControl != null) {
|
||||||
|
monitoringControl.updateInfo(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}, (Void) null);
|
}, (Void) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue