• support@answerspoint.com

Get screen dimensions in pixels

2791

I created some custom elements, and I want to programmatically place them to the upper right corner (n pixels from the top edge and m pixels from the right edge). Therefore I need to get the screen width and screen height and then set position:

int px = screenWidth - m;
int py = screenHeight - n;

How do I get screenWidth and screenHeight in the main Activity?

0Answer


Your Answer

    Facebook Share        
       
  • asked 9 years ago
  • viewed 2791 times
  • active 9 years ago

Best Rated Questions