I know how to get the dimensions of the screen onCreate. I was making a runnable which will allow me to get the dimensions inside of that.
The thing is that when i rotate my device, it doesnt seem to properly return the dimensions.
I was thinking to do it onConfigurationChanged() as that seems to firre when i rotate my device. I was trying to do the following but i dont think it was giving valid data.
Rect r = new Rect();
Window win = getWindow();
win,getDecorView().getWindowVisibleDisplayFrame(r);
int height = r.height();
int width = r.width();
but it seems that they arent correct. I was trying to move a created item around the screen, and it doesnt go to the edges of the screen. I dont think it has anything to do with my drag function.
I feel the dimensions are incorrect.
How is this done? Am i on the right path?