The Android coordinate origin is the upper-left corner, and if it is a view, then the upper-left corner of the matrix is the origin.
1. Absolute coordinates location
int[] location = new int[2]; View.getlocationinwindow (position);//Gets the absolute coordinates within the current window, Containing Toolbarview.getlocationonscreen (location); Gets the absolute coordinates of the entire screen, including statusbar//location [0]--->x coordinates, location [1]--->y coordinates//needs to be loaded in the UI control to get it correctly. For example, gets in the Onwindowfocuschanged (Boolean Hasfocus) callback.
2, through the layoutparams to obtain the position, need to note is, PARAMS.Y is in the window absolute coordinates, does not contain StatusBar
Windowmanager.layoutparams LP = GetWindow (). GetAttributes (); lp.x= x;lp.y= y;
3. Get the coordinates relative to his father
View.getleft (), GetTop (), Getbottom (), GetRight ()
4, get screen height, title height, status bar height detailed
5, click the coordinates of the more detailed article
Android gets the coordinates of the control in the screen-summary