Created
November 24, 2016 15:30
-
-
Save koral--/8fb13654129a62c26ceb1de0ec29eedb to your computer and use it in GitHub Desktop.
VersionCodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void foo() { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
long x = JobInfo.getMinPeriodMillis(); //available on N+, no lint error | |
} else { | |
long x = JobInfo.getMinPeriodMillis(); //available on M-, lint error | |
} | |
if (isNougatOrAbove()) { | |
long x = JobInfo.getMinPeriodMillis(); //available on N+, no lint error | |
} else { | |
long x = JobInfo.getMinPeriodMillis(); //available on M-, lint check does not work! | |
} | |
} | |
public static boolean isNougatOrAbove() { | |
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment