Fixed java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowManager android.app.Activity.getWindowManager()' on a null object reference
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 e143b51..443739c 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;