int[] location = new INT[2];
View.getlocationinwindow (location); Gets the absolute coordinates within the current window
View.getlocationonscreen (location);//get absolute coordinates across the screen
Location [0]--->x coordinates, location [1]--->y coordinates
Getlocationonscreen
Get the X, Y value of the view in the global coordinate system (note that this value is calculated from the top of the screen, that is, the height of the notification bar is included)//Gets the absolute coordinates in the current screen
Getlocationinwindow , calculates the x, Y value of the view in its widnow coordinates,//Gets the absolute coordinates within the entire window
getLeft , getTop, getbottom,getRight, this group is getting the coordinates relative to its father
Note that it is written in the Onwindowfocuschanged method, otherwise it will appear to have a value of 0.
Android gets the absolute coordinates of the control in the screen Getlocationinwindow and Getlocationonscreen