I have a program with a single View filling the screen under the notification bar and the app's title bar.
get(Height) correctly tells me the height in pixels of the View;
getY() applied to a MotionEvent gives the distance in pixels from the top of the screen.
I know that in the emulator and in my current device the top of the view is 50 pixels from the top of the screen so I can subtract 50 from getY() to determine the Y coordinate relative to the top of the View.
However, presumably I can't rely on this difference always being 50, so how can I programmatically deterrmine the coordinates of the top (and left) of the View?