I am trying to get the x and y coordinates of the center of the screen. Here is what I tried:
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
But this does not work when I say:
SomeImageView.setY(centerY);
I do not see him in the center of the screen. Can anyone help me with this?
thanks
source share