diff --git a/OsmAnd/src/net/osmand/plus/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/ApplicationMode.java index 3f41186ace..eebdedaa1b 100644 --- a/OsmAnd/src/net/osmand/plus/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/ApplicationMode.java @@ -534,6 +534,4 @@ public class ApplicationMode { ApplicationMode.saveCustomModeToSettings(app.getSettings()); } - - } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java b/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java index fdbaf9b725..97ad04f617 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/profiles/ProfileMenuAdapter.java @@ -42,9 +42,11 @@ public class ProfileMenuAdapter extends RecyclerView.Adapter notifyDataSetChanged(); } - public void updateItemsList(List newList) { + public void updateItemsList(List newList, Set selectedItems) { items.clear(); + this.selectedItems.clear(); items.addAll(newList); + this.selectedItems.addAll(selectedItems); notifyDataSetChanged(); } diff --git a/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java b/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java index 5ed43c932f..addf41ae70 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java @@ -143,7 +143,7 @@ public class SettingsProfileFragment extends BaseOsmAndFragment { allAppModes = ApplicationMode.allPossibleValues(); allAppModes.remove(ApplicationMode.DEFAULT); - adapter.updateItemsList(allAppModes); + adapter.updateItemsList(allAppModes, new LinkedHashSet<>(ApplicationMode.values(getMyApplication()))); } static ArrayList getBaseProfiles(Context ctx) {