From d3f47d103165a07b5478c9e9f675ba03570e04c4 Mon Sep 17 00:00:00 2001 From: goldfingerfif Date: Tue, 16 Sep 2014 14:10:22 -0500 Subject: [PATCH] Update "MainPage.java" to support Android 'L' Using something such as OS Version worked fine in the past but for something such as Android 'L' we should use SDK version or the app will not open on the phone since it will go to the else statement. I was running into this problem and this is the solution that worked for me. --- .../src/com/redbear/redbearbleclient/MainPage.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Examples/BLEController/src/com/redbear/redbearbleclient/MainPage.java b/Examples/BLEController/src/com/redbear/redbearbleclient/MainPage.java index 4b0e849..ead019b 100644 --- a/Examples/BLEController/src/com/redbear/redbearbleclient/MainPage.java +++ b/Examples/BLEController/src/com/redbear/redbearbleclient/MainPage.java @@ -67,10 +67,16 @@ protected void onCreate(Bundle savedInstanceState) { actionBar.setCustomView(actionbar_layout); setContentView(R.layout.activity_main_page); - + + /* String osVersion = Build.VERSION.RELEASE; if ((osVersion.charAt(0)) == '4' && (osVersion.charAt(1) == '.') && (osVersion.charAt(2) >= '3')) { + */ + + int sdkVersion = android.os.Build.VERSION.SDK_INT; + + if(sdkVersion >= 18) { } else { AlertDialog.Builder dialog = new AlertDialog.Builder(MainPage.this);