I am trying to incorporate a try/catch in order to support a deprecated method.
If my minSdkVersion is too low to support the (newer) method that I am trying, Eclipse sees an error because it isn't supported (yet). How do I get Eclipse to ignore this line?
Here's the code:
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
try {
display.getSize(size);
width = size.x;
height = size.y;
} catch (NoSuchMethodError e) {
width = display.getWidth();
height = display.getHeight();
}
With a minsdkversion before 14, eclipse doesn't like the Display.getSize(size).
Alternatively, is there a better way to do this?
thanks