mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-24 04:35:03 +00:00
Android: getCurrentOrientation uses getContext() to retrieve the activity (see bug #4825)
This commit is contained in:
parent
0e294e90ae
commit
325ae5c35d
|
@ -381,10 +381,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
public static int getCurrentOrientation() {
|
public static int getCurrentOrientation() {
|
||||||
int result = SDL_ORIENTATION_UNKNOWN;
|
int result = SDL_ORIENTATION_UNKNOWN;
|
||||||
|
|
||||||
if (mSingleton == null) {
|
Activity activity = (Activity)getContext();
|
||||||
|
if (activity == null) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
Display display = SDLActivity.mSingleton.getWindowManager().getDefaultDisplay();
|
Display display = activity.getWindowManager().getDefaultDisplay();
|
||||||
|
|
||||||
switch (display.getRotation()) {
|
switch (display.getRotation()) {
|
||||||
case Surface.ROTATION_0:
|
case Surface.ROTATION_0:
|
||||||
|
|
Loading…
Reference in a new issue