title: Android BLE not connecting correctly to device
body: <p>A bit of background first, I am using a RedBear Blend microcontroller to attempt to send data into an Android application over BLE for a University project which is utilising some Open Source Blood Glucose meter hardware and attempting to turn it into a "smart" device with a companion application to log the data. </p>
  
  <p>This works fine when using the example RedBear chat app available here: <a href="https://github.com/RedBearLab/Android/tree/master/Examples/Chat" rel="nofollow noreferrer">https://github.com/RedBearLab/Android/tree/master/Examples/Chat</a></p>
  
  <p>Logcat from the example application:</p>
  
  <pre><code>5-01 12:39:26.316 2753-2753/com.redbear.chat W/System: ClassLoader referenced unknown path: /data/app/com.redbear.chat-1/lib/arm
  05-01 12:39:26.406 2753-2753/com.redbear.chat D/SecWifiDisplayUtil: Metadata value : none
  05-01 12:39:26.406 2753-2753/com.redbear.chat D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{6a1bff8 I.E...... R.....ID 0,0-0,0}
  05-01 12:39:26.406 2753-2861/com.redbear.chat D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
  05-01 12:39:26.456 2753-2861/com.redbear.chat I/Adreno: QUALCOMM build                   : d842ad3, Ia10634f51b
                                                          Build Date                       : 01/04/16
                                                          OpenGL ES Shader Compiler Version: XE031.06.00.05
                                                          Local Branch                     : mybranch17578993
                                                          Remote Branch                    : quic/LA.BF.2.1.2_rb1.7
                                                          Remote Branch                    : NONE
                                                          Reconstruct Branch               : NOTHING
  05-01 12:39:26.456 2753-2861/com.redbear.chat D/libEGL: eglInitialize EGLDisplay = 0xae1e87c4
  05-01 12:39:26.456 2753-2861/com.redbear.chat I/OpenGLRenderer: Initialized EGL, version 1.4
  05-01 12:39:26.486 2753-2753/com.redbear.chat D/BluetoothGatt: connect() - device: F0:44:62:58:BB:ED, auto: false
  05-01 12:39:26.486 2753-2753/com.redbear.chat D/BluetoothGatt: registerApp()
  05-01 12:39:26.486 2753-2753/com.redbear.chat D/BluetoothGatt: registerApp() - UUID=345487dc-e3ef-4a26-866c-b504f43c14c3
  05-01 12:39:26.526 2753-2753/com.redbear.chat D/RBLService: Trying to create a new connection.
  05-01 12:39:26.526 2753-2769/com.redbear.chat D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
  05-01 12:39:26.536 2753-2753/com.redbear.chat W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 12:39:26.536 2753-2753/com.redbear.chat W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 12:39:26.546 2753-2861/com.redbear.chat D/libGLESv1: DTS_GLAPI : DTS is not allowed for Package : com.redbear.chat
  05-01 12:39:26.576 2753-2861/com.redbear.chat V/RenderScript: 0x9e09e000 Launching thread(s), CPUs 4
  05-01 12:39:26.586 2753-2753/com.redbear.chat D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
  05-01 12:39:26.606 2753-2753/com.redbear.chat I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@ca8aa6a time:49435618
  05-01 12:39:26.726 2753-2753/com.redbear.chat D/ViewRootImpl: MSG_RESIZED: ci=Rect(0, 96 - 0, 996) vi=Rect(0, 96 - 0, 996) or=1
  05-01 12:39:28.976 2753-2809/com.redbear.chat D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=F0:44:62:58:BB:ED
  05-01 12:39:28.986 2753-2809/com.redbear.chat I/RBLService: Connected to GATT server.
  05-01 12:39:28.996 2753-2809/com.redbear.chat D/BluetoothGatt: discoverServices() - device: F0:44:62:58:BB:ED
  05-01 12:39:28.996 2753-2809/com.redbear.chat I/RBLService: Attempting to start service discovery:true
  05-01 12:39:29.276 2753-2768/com.redbear.chat D/BluetoothGatt: onClientConnParamsChanged() - Device=F0:44:62:58:BB:ED interval=6 status=0
  05-01 12:39:29.536 2753-2768/com.redbear.chat D/BluetoothGatt: onSearchComplete() = Device=F0:44:62:58:BB:ED Status=0
  05-01 12:39:29.536 2753-2753/com.redbear.chat D/BluetoothGatt: setCharacteristicNotification() - uuid: 713d0002-503e-4c75-ba94-3148f18d941e enable: true
  05-01 12:39:29.566 2753-2809/com.redbear.chat D/BluetoothGatt: onClientConnParamsChanged() - Device=F0:44:62:58:BB:ED interval=39 status=0
  05-01 12:39:34.846 2753-2769/com.redbear.chat D/BluetoothGatt: onClientConnParamsChanged() - Device=F0:44:62:58:BB:ED interval=18 status=0
  05-01 12:40:25.866 2753-2753/com.redbear.chat V/ActivityThread: updateVisibility : ActivityRecord{f85a5ca token=android.os.BinderProxy@ca8aa6a {com.redbear.chat/com.redbear.chat.Chat}} show : true
  05-01 12:40:31.266 2753-2753/com.redbear.chat D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 1092) vi=Rect(0, 96 - 0, 1092) or=1
  05-01 12:40:31.296 2753-2753/com.redbear.chat D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
  </code></pre>
  
  <p>However when I am trying to port the functionality into my application it looks as though they are not correctly connecting as I do not get the same output to logcat, instead the application crashes with a null pointer exception as the connection hasn't properly initialised. So I'm not sure what I'm doing incorrectly, in order to get the devices to successfully connect.</p>
  
  <p>I have attempted to port the functionality from the example into my application in the following files:</p>
  
  <pre><code>MainActivity.java
  Device.java
  StoreReading.java
  TakeReading.java
  </code></pre>
  
  <p>The application is on my github. <a href="https://github.com/rowmanns/android_ble/tree/master/BloodGlucoseV3" rel="nofollow noreferrer">https://github.com/rowmanns/android_ble/tree/master/BloodGlucoseV3</a></p>
  
  <pre><code>05-01 13:03:57.606 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{1186991 I.E...... R.....ID 0,0-0,0}
  05-01 13:03:57.616 25495-25645/com.fyp.rowan.bloodglucosev3 D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
  05-01 13:03:57.646 25495-25645/com.fyp.rowan.bloodglucosev3 I/Adreno: QUALCOMM build                   : d842ad3, Ia10634f51b
                                                                        Build Date                       : 01/04/16
                                                                        OpenGL ES Shader Compiler Version: XE031.06.00.05
                                                                        Local Branch                     : mybranch17578993
                                                                        Remote Branch                    : quic/LA.BF.2.1.2_rb1.7
                                                                        Remote Branch                    : NONE
                                                                        Reconstruct Branch               : NOTHING
  05-01 13:03:57.646 25495-25645/com.fyp.rowan.bloodglucosev3 D/libEGL: eglInitialize EGLDisplay = 0x9f7ff7c4
  05-01 13:03:57.646 25495-25645/com.fyp.rowan.bloodglucosev3 I/OpenGLRenderer: Initialized EGL, version 1.4
  05-01 13:03:57.676 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
  05-01 13:03:57.686 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:03:57.686 25495-25645/com.fyp.rowan.bloodglucosev3 D/libGLESv1: DTS_GLAPI : DTS is not allowed for Package : com.fyp.rowan.bloodglucosev3
  05-01 13:03:57.716 25495-25495/com.fyp.rowan.bloodglucosev3 I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@49e44d2 time:50906726
  05-01 13:04:00.116 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: ViewPostImeInputStage processPointer 0
  05-01 13:04:00.206 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: ViewPostImeInputStage processPointer 1
  05-01 13:04:00.216 25495-25495/com.fyp.rowan.bloodglucosev3 I/Timeline: Timeline: Activity_launch_request id:com.fyp.rowan.bloodglucosev3 time:50909220
  05-01 13:04:00.266 25495-25495/com.fyp.rowan.bloodglucosev3 I/ToolbarWidgetWrapper: Progress display unsupported
  05-01 13:04:00.286 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: startLeScan(): null
  05-01 13:04:00.286 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:00.286 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:00.286 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothLeScanner: Start Scan
  05-01 13:04:00.286 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:00.296 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:00.296 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:00.296 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:00.306 25495-25495/com.fyp.rowan.bloodglucosev3 D/SecWifiDisplayUtil: Metadata value : none
  05-01 13:04:00.316 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{948186d V.E...... R.....I. 0,0-0,0}
  05-01 13:04:00.326 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{358dc4c I.E...... R.....ID 0,0-0,0}
  05-01 13:04:00.336 25495-25583/com.fyp.rowan.bloodglucosev3 D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5
  05-01 13:04:00.406 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
  05-01 13:04:00.406 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:04:00.426 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.426 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:04:00.436 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
  05-01 13:04:00.466 25495-25645/com.fyp.rowan.bloodglucosev3 D/OpenGLRenderer: endAllActiveAnimators on 0xb2b49680 (RippleDrawable) with handle 0xa91ee510
  05-01 13:04:00.466 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.476 25495-25495/com.fyp.rowan.bloodglucosev3 I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@bac547f time:50909481
  05-01 13:04:00.526 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.576 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.626 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.686 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.726 25495-25495/com.fyp.rowan.bloodglucosev3 V/ActivityThread: updateVisibility : ActivityRecord{c3a515a token=android.os.BinderProxy@49e44d2 {com.fyp.rowan.bloodglucosev3/com.fyp.rowan.bloodglucosev3.MainActivity}} show : false
  05-01 13:04:00.746 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.846 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.896 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:00.956 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.016 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.076 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.136 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.196 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.276 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.326 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.366 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.416 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.476 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.536 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.586 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.646 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.696 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.746 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.806 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.866 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.926 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:01.966 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.026 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.146 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.206 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.266 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.316 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.376 25495-25588/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.436 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.486 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.546 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.606 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.646 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.696 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.756 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.816 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.876 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.926 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:02.986 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:03.046 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:03.106 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:03.166 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:03.216 25495-25507/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:03.286 25495-25506/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:03.326 25495-25733/com.fyp.rowan.bloodglucosev3 I/Timeline: Timeline: Activity_launch_request id:com.fyp.rowan.bloodglucosev3 time:50912335
  05-01 13:04:03.336 25495-25583/com.fyp.rowan.bloodglucosev3 D/ScanRecord: parseFromBytes
  05-01 13:04:03.346 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: stopLeScan()
  05-01 13:04:03.346 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:03.346 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:03.346 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:03.356 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothAdapter: STATE_ON
  05-01 13:04:03.356 25495-25731/com.fyp.rowan.bloodglucosev3 D/BluetoothLeScanner: Stop Scan
  05-01 13:04:03.396 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: #3 mView = null
  05-01 13:04:03.406 25495-25495/com.fyp.rowan.bloodglucosev3 E/ViewRootImpl: sendUserActionEvent() mView == null
  05-01 13:04:03.426 25495-25495/com.fyp.rowan.bloodglucosev3 D/AbsListView: Get MotionRecognitionManager
  05-01 13:04:03.426 25495-25495/com.fyp.rowan.bloodglucosev3 E/MotionRecognitionManager: mSContextService = android.hardware.scontext.ISContextService$Stub$Proxy@35944f3
  05-01 13:04:03.436 25495-25495/com.fyp.rowan.bloodglucosev3 E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@393d4f
  05-01 13:04:03.436 25495-25495/com.fyp.rowan.bloodglucosev3 E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@393d4f
  05-01 13:04:03.436 25495-25495/com.fyp.rowan.bloodglucosev3 D/SecWifiDisplayUtil: Metadata value : none
  05-01 13:04:03.436 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{1765f6b I.E...... R.....ID 0,0-0,0}
  05-01 13:04:03.486 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:04:03.496 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
  05-01 13:04:03.536 25495-25495/com.fyp.rowan.bloodglucosev3 I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@81584ba time:50912545
  05-01 13:04:03.756 25495-25495/com.fyp.rowan.bloodglucosev3 V/ActivityThread: updateVisibility : ActivityRecord{fbc0c5e token=android.os.BinderProxy@bac547f {com.fyp.rowan.bloodglucosev3/com.fyp.rowan.bloodglucosev3.TakeReading}} show : false
  05-01 13:04:04.976 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: ViewPostImeInputStage processPointer 0
  05-01 13:04:05.076 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: ViewPostImeInputStage processPointer 1
  05-01 13:04:05.156 25495-25495/com.fyp.rowan.bloodglucosev3 I/Timeline: Timeline: Activity_launch_request id:com.fyp.rowan.bloodglucosev3 time:50914163
  05-01 13:04:05.236 25495-25495/com.fyp.rowan.bloodglucosev3 D/SecWifiDisplayUtil: Metadata value : none
  05-01 13:04:05.236 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{5f5d546 I.E...... R.....ID 0,0-0,0}
  05-01 13:04:05.296 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:04:05.296 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:04:05.316 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
  05-01 13:04:05.336 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:04:05.356 25495-25645/com.fyp.rowan.bloodglucosev3 D/OpenGLRenderer: endAllActiveAnimators on 0x9b0cc680 (ListView) with handle 0x9d855ee0
  05-01 13:04:05.356 25495-25495/com.fyp.rowan.bloodglucosev3 I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@3d1f88 time:50914367
  05-01 13:04:05.496 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: MSG_RESIZED: ci=Rect(0, 96 - 0, 996) vi=Rect(0, 96 - 0, 996) or=1
  05-01 13:04:05.586 25495-25495/com.fyp.rowan.bloodglucosev3 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
  05-01 13:04:05.606 25495-25495/com.fyp.rowan.bloodglucosev3 D/ViewRootImpl: #3 mView = null
  05-01 13:04:16.176 25495-25495/com.fyp.rowan.bloodglucosev3 D/AndroidRuntime: Shutting down VM
  05-01 13:04:16.186 25495-25495/com.fyp.rowan.bloodglucosev3 E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                Process: com.fyp.rowan.bloodglucosev3, PID: 25495
                                                                                java.lang.RuntimeException: Unable to destroy activity {com.fyp.rowan.bloodglucosev3/com.fyp.rowan.bloodglucosev3.StoreReading}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.fyp.rowan.bloodglucosev3.RBLService.disconnect()' on a null object reference
                                                                                    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5062)
                                                                                    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5085)
                                                                                    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5348)
                                                                                    at android.app.ActivityThread.access$1200(ActivityThread.java:221)
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                    at android.os.Looper.loop(Looper.java:158)
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:7225)
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
                                                                                 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.fyp.rowan.bloodglucosev3.RBLService.disconnect()' on a null object reference
                                                                                    at com.fyp.rowan.bloodglucosev3.StoreReading.onDestroy(StoreReading.java:155)
                                                                                    at android.app.Activity.performDestroy(Activity.java:7102)
                                                                                    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1170)
                                                                                    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5040)
                                                                                    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5085) 
                                                                                    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5348) 
                                                                                    at android.app.ActivityThread.access$1200(ActivityThread.java:221) 
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800) 
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                    at android.os.Looper.loop(Looper.java:158) 
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:7225) 
                                                                                    at java.lang.reflect.Method.invoke(Native Method) 
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
  </code></pre>
  
  <p>Any help/ideas would be greatly appreciated!</p>