diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java index ff61980ea2..8253693fb6 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -51,6 +51,7 @@ import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; +import android.hardware.Sensor; import android.hardware.SensorManager; import android.graphics.Canvas; import android.graphics.ColorFilter; @@ -807,10 +808,10 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa } //Looks like screenOrientation correction must not be applied for devices without compass? - // Sensor s = ((SensorManager) getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); - // if (s == null) { - // screenOrientation = 0; - // } + Sensor s = ((SensorManager) getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); + if (s == null) { + screenOrientation = 0; + } draw.setAngle(mes[1] - a + 180 + screenOrientation); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java index 8e333cbd22..1b3aa6ea1c 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java @@ -3,6 +3,7 @@ package net.osmand.plus.dashboard; import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.hardware.Sensor; import android.hardware.SensorManager; import android.graphics.Typeface; import android.graphics.drawable.Drawable; @@ -206,10 +207,10 @@ public class DashFavoritesFragment extends DashBaseFragment { } //Looks like screenOrientation correction must not be applied for devices without compass? - // Sensor s = ((SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); - // if (s == null) { - // screenOrientation = 0; - // } + Sensor s = ((SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); + if (s == null) { + screenOrientation = 0; + } draw.setAngle(mes[1] - a + 180 + screenOrientation);