How to get screen size (in pixels)? I used
Display display = getWindowManager().getDefaultDisplay(); 
Point size = new Point(); 
display.getSize(size);
int width = size.x; 
int height = size.y;`
but it doesn't work...
How to get screen size (in pixels)? I used
Display display = getWindowManager().getDefaultDisplay(); 
Point size = new Point(); 
display.getSize(size);
int width = size.x; 
int height = size.y;`
but it doesn't work...
 
    
    use this
Display display = getWindowManager().getDefaultDisplay(); 
int width = display.getWidth(); 
int height = display.getHeight();
 
    
    Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();     
int width = display.getWidth();
int height = display.getHeight();
