Skip to content

Commit

Permalink
Android: getCurrentOrientation uses getContext() to retrieve the acti…
Browse files Browse the repository at this point in the history
…vity (see bug #4825)
  • Loading branch information
1bsyl committed Oct 13, 2021
1 parent 0e294e9 commit 325ae5c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,11 @@ protected void onStart() {
public static int getCurrentOrientation() {
int result = SDL_ORIENTATION_UNKNOWN;

if (mSingleton == null) {
Activity activity = (Activity)getContext();
if (activity == null) {
return result;
}
Display display = SDLActivity.mSingleton.getWindowManager().getDefaultDisplay();
Display display = activity.getWindowManager().getDefaultDisplay();

switch (display.getRotation()) {
case Surface.ROTATION_0:
Expand Down

0 comments on commit 325ae5c

Please sign in to comment.