1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Use Build.VERSION.SDK_INT instead of parsing Build.VERSION.SDK

This commit is contained in:
cketti 2011-11-10 05:39:04 +01:00
parent 14ff4d006e
commit 07fa0c7264
3 changed files with 3 additions and 7 deletions

View File

@ -265,7 +265,7 @@ public class Prefs extends K9PreferenceActivity {
mZoomControlsEnabled.setChecked(K9.zoomControlsEnabled());
mMobileOptimizedLayout = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT);
if (Integer.parseInt(Build.VERSION.SDK) <= 7) {
if (Build.VERSION.SDK_INT <= 7) {
mMobileOptimizedLayout.setEnabled(false);
}

View File

@ -40,10 +40,8 @@ public abstract class Contacts {
* Check the version of the SDK we are running on. Choose an
* implementation class designed for that version of the SDK.
*/
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
String className = null;
if (sdkVersion <= Build.VERSION_CODES.ECLAIR_MR1) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ECLAIR_MR1) {
/*
* The new API was introduced with SDK 5. But Android versions < 2.2
* need some additional code to be able to search for phonetic names.

View File

@ -91,9 +91,7 @@ public class MessageWebView extends WebView {
// SINGLE_COLUMN layout was broken on Android < 2.2, so we
// administratively disable it
if (
(Integer.parseInt(Build.VERSION.SDK) > 7)
&& K9.mobileOptimizedLayout()) {
if (Build.VERSION.SDK_INT > 7 && K9.mobileOptimizedLayout()) {
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
} else {
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);