I have a little issue here... I want to get the size of the display, which I can get either by calling the deprecated Display.getWidth
/ .getHeight
or I can use Display.getSize
...
But heres my problem... I don't want to use deprecated code, so that leaves me with Display.getSize
... But that requires API 13
and I would like my min-API to be 8....
What should I do? Is there another option?
Point size = new Point();
display.getSize(size);
width = size.x;
height = size.y;
vs
width = display.getWidth();
height = display.getHeight();
Use Display Metrics
DisplayMetrics display = this.getResources().getDisplayMetrics();
int width = display.widthPixels;
int height = display.heightPixels;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With