Reputation: 573
What would be the equivalent of the getSize() method pre-API level 13? Specifically, I need something that would work with Gingerbread.
Context context = getActivity();
Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
Point size = new Point();
display.getSize(size);
Upvotes: 4
Views: 1066
Reputation: 1247
Try:
width=display.getWidth();
height=display.getHeight();
when target is >= Gingerbread
Upvotes: 3