From 39c3ef08b3f6cc962040aea66815507c12e9cd43 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Fri, 25 Dec 2015 18:24:05 +0200 Subject: [PATCH] Run live updates right after Live updates enable for item. --- .../liveupdates/LiveUpdatesSettingsDialogFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsDialogFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsDialogFragment.java index 648521ddf0..6758f2c8e0 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesSettingsDialogFragment.java @@ -125,7 +125,12 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment { .setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - liveUpdatePreference.set(liveUpdatesSwitch.isChecked()); + if (liveUpdatePreference.get() != liveUpdatesSwitch.isChecked()) { + liveUpdatePreference.set(liveUpdatesSwitch.isChecked()); + if (liveUpdatesSwitch.isChecked()) { + runLiveUpdate(localIndexInfo); + } + } downloadViaWiFiPreference.set(downloadOverWiFiCheckBox.isChecked()); final int updateFrequencyInt = updateFrequencySpinner.getSelectedItemPosition();