diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index e143b519f..443739c14 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -1012,6 +1012,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh public static boolean isTablet() { DisplayMetrics metrics = new DisplayMetrics(); Activity activity = (Activity)getContext(); + if (activity == null) { + return false; + } activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); double dWidthInches = metrics.widthPixels / (double)metrics.xdpi;