I want to use the function activity.getWindowManager().getDefaultDisplay().getwidth() but there is a warning that says this function is deprecated
What should I do ? Should I use this function anyway? or there is some other functions that do the same ?
Deprecated means that it shouldn't be used, but it's still there for compability reasons.
You should use instead:
Point size = new Point();
activity.getWindowManager().getDefaultDisplay().getSize(size);
int width = size.x;
int height = size.y;
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