mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	Fixed java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowManager android.app.Activity.getWindowManager()' on a null object reference
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Sam Lantinga
					Sam Lantinga