mirror of
				https://github.com/encounter/SDL.git
				synced 2025-10-28 12:39:47 +00:00 
			
		
		
		
	Fixed bug #4825 - NullPointerException on SDLActivity.getCurrentOrientation() (Thanks Benau!)
This commit is contained in:
		
							parent
							
								
									1b49f09243
								
							
						
					
					
						commit
						723f5cea43
					
				| @ -379,11 +379,13 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh | ||||
|     } | ||||
| 
 | ||||
|     public static int getCurrentOrientation() { | ||||
|         final Context context = SDLActivity.getContext(); | ||||
|         final Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); | ||||
| 
 | ||||
|         int result = SDL_ORIENTATION_UNKNOWN; | ||||
| 
 | ||||
|         if (mSingleton == null) { | ||||
|             return result; | ||||
|         } | ||||
|         Display display = SDLActivity.mSingleton.getWindowManager().getDefaultDisplay(); | ||||
| 
 | ||||
|         switch (display.getRotation()) { | ||||
|             case Surface.ROTATION_0: | ||||
|                 result = SDL_ORIENTATION_PORTRAIT; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user