title: Getting the actual screen height (android)
body: <p>I want to get the actual screen height of the device that runs my app. To achieve this i try the following:</p>
  <pre><code>DisplayMetrics metrics = new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(metrics);
  
  int Height = metrics.heightPixels;
  TextView HeightView = (TextView) findViewById(R.id.screenHeight);
  HeightView.setText(&quot;Screen Height: &quot; + Height);
  
  int Width = metrics.widthPixels;
  TextView WidthView = (TextView) findViewById(R.id.screenWidth);
  WidthView.setText(&quot;Screen Width: &quot; + Width);
  </code></pre>
  <p>The device that I run using the emulator has a screen width of 1080 pixels and a screen height of 1920 pixels. The width is displayed correctly (1080 pixels) but the height is according to the app only 1776 pixels. What do I need to make my app display the correct screen height? Is <code>metrics.heightPixels</code> a bad way of getting the screen height?</p>