Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Simplify call for getting the WindowManager instance within…
… EmulationActivity.
  • Loading branch information
lioncash committed Oct 3, 2013
1 parent cb3afe8 commit c517b7f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -45,7 +45,7 @@ public void onCreate(Bundle savedInstanceState)

// Retrieve screen dimensions.
DisplayMetrics displayMetrics = new DisplayMetrics();
WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); // the results will be higher than using the activity context object or the getWindowManager() shortcut
WindowManager wm = getWindowManager();
wm.getDefaultDisplay().getMetrics(displayMetrics);
this.screenHeight = displayMetrics.heightPixels;
this.screenWidth = displayMetrics.widthPixels;
Expand Down

0 comments on commit c517b7f

Please sign in to comment.