title: How to get the center coordinates of the screen in android?
body: <p>I am trying to get the x and y coordinates of the center of the screen. Here is what i tried:</p>
  
  <pre><code>Display display = getWindowManager().getDefaultDisplay();
  final Point size = new Point();
  display.getSize(size);
  height = size.y;
  float centerY=height/2;//i expect this is the y coordinate of center
  </code></pre>
  
  <p>But this does not work, when i say:</p>
  
  <pre><code>SomeImageView.setY(centerY);
  </code></pre>
  
  <p>I do not see it at the center of the screen. Can anyone help me with this?</p>
  
  <p>Thanks</p>