diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 6e98272927..16dd773404 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -11,6 +11,7 @@
Thx - Hardy
-->
+ Please turn on at least one application profile, to use this setting.
Winter road
Ice road
Winter and ice roads
diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
index e070268d07..a3c93cdbda 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
@@ -339,6 +339,14 @@ public class OsmandSettings {
public ApplicationMode getApplicationMode() {
return APPLICATION_MODE.get();
}
+
+ public boolean hasAvailableApplicationMode() {
+ int currentModeCount = ApplicationMode.values(ctx).size();
+ if (currentModeCount == 0 || currentModeCount == 1 && getApplicationMode() == ApplicationMode.DEFAULT) {
+ return false;
+ }
+ return true;
+ }
protected ApplicationMode readApplicationMode() {
String s = settingsAPI.getString(globalPreferences, APPLICATION_MODE.getId(), ApplicationMode.DEFAULT.getStringKey());
diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java
index 8649c08af5..a3d790470e 100644
--- a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java
@@ -25,6 +25,7 @@ import android.widget.ArrayAdapter;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
+import android.widget.Toast;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
@@ -81,6 +82,11 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState);
+ settings = getMyApplication().getSettings();
+ if (!settings.hasAvailableApplicationMode()) {
+ Toast.makeText(this, R.string.turn_on_profile_desc, Toast.LENGTH_SHORT).show();
+ onBackPressed();
+ }
getToolbar().setTitle(R.string.routing_settings);
createUI();
}
@@ -98,7 +104,6 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
private void createUI() {
addPreferencesFromResource(R.xml.navigation_settings);
PreferenceScreen screen = getPreferenceScreen();
- settings = getMyApplication().getSettings();
RouteService[] vls = RouteService.getAvailableRouters(getMyApplication());
String[] entries = new String[vls.length];
for (int i = 0; i < entries.length; i++) {