aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/compatibility/AndroidLevel8Emulation.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/compatibility/AndroidLevel8Emulation.java')
-rw-r--r--main/src/cgeo/geocaching/compatibility/AndroidLevel8Emulation.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/compatibility/AndroidLevel8Emulation.java b/main/src/cgeo/geocaching/compatibility/AndroidLevel8Emulation.java
index a60b48d..6d5781f 100644
--- a/main/src/cgeo/geocaching/compatibility/AndroidLevel8Emulation.java
+++ b/main/src/cgeo/geocaching/compatibility/AndroidLevel8Emulation.java
@@ -19,7 +19,11 @@ public class AndroidLevel8Emulation implements AndroidLevel8Interface {
@Override
public int getRotationOffset(Activity activity) {
final Display display = activity.getWindowManager().getDefaultDisplay();
+
+ // the non deprecated method is available in API 8+ only, so we cannot deal better with this
+ @SuppressWarnings("deprecation")
final int rotation = display.getOrientation();
+
if (rotation == Configuration.ORIENTATION_LANDSCAPE) {
return 90;
}