Android Call requires API level 13 (current min is 10): android.view.Display#getSize
android
Solution
You already have the SDK version checking in place so the deprecation warning from compiler and lint warning about new API can be ignored.
Pull the code snippet to a separate method and add the following annotations to it:
@TargetApi(13)
@SuppressWarnings("deprecation")
Note that the `if` part of your `else if` is redundant. Plain `else` is enough.
Problem
I'm trying to target as many architectures as possible, as well as having few warnings as possible. ``` Point dims = new Point(); if (android.os.Build.VERSION.SDK_INT >= 13) { mWindowManager.getDefaultDisplay().getSize(dims); } else if (android.os.Build.VERSION.SDK_INT < 13) { dims.x = mWindowManager.getDefaultDisplay().getWidth(); dims.y = mWindowManager.getDefaultDisplay().getHeight(); } ``` But this gives me the error and warning: ``` Call requires API level 13 (current min is 10): android.view.Display#getSize The method getWidth() from the type Display is deprecated ``` They say to change the manifesto (or here) but why is this above not working for the compiler? Can't I get rid of both with the range of apis 10 to 18 ?