We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b49f09 commit 723f5ceCopy full SHA for 723f5ce
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -379,11 +379,13 @@ protected void onStart() {
379
}
380
381
public static int getCurrentOrientation() {
382
- final Context context = SDLActivity.getContext();
383
- final Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
384
-
385
int result = SDL_ORIENTATION_UNKNOWN;
386
+ if (mSingleton == null) {
+ return result;
+ }
387
+ Display display = SDLActivity.mSingleton.getWindowManager().getDefaultDisplay();
388
+
389
switch (display.getRotation()) {
390
case Surface.ROTATION_0:
391
result = SDL_ORIENTATION_PORTRAIT;
0 commit comments