Android display getSize () up to API level 13

What will be the equivalent of the pre-API method of getSize () method? In particular, I need something that will work with Gingerbread.

Context context = getActivity();
Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
Point size = new Point();
display.getSize(size);
+4
source share
1 answer

Try:

width=display.getWidth();
height=display.getHeight();

when the target is> = Gingerbread

+3
source

All Articles