I need to get the window height and the weight. I have this in my code:
DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDispl
Please check if you are calling above method in an activity class, or outside activity.
For Wallpaper, this method is not availed to you to get height or width of window, you need to get width and height of available window by using surface.