- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
首先介绍一些背景知识,我正在使用 RedBear Blend 微 Controller 尝试通过 BLE 将数据发送到一个大学项目的 Android 应用程序中,该项目使用一些开源血糖仪硬件,并尝试将其变成带有配套应用程序的“智能”设备来记录数据。
使用此处提供的示例 RedBear 聊天应用程序时效果很好:https://github.com/RedBearLab/Android/tree/master/Examples/Chat
示例应用程序中的 Logcat:
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
但是,当我尝试将功能移植到我的应用程序中时,它们似乎没有正确连接,因为我没有得到相同的输出到 logcat,相反,由于连接尚未正确初始化,应用程序因空指针异常而崩溃。所以我不确定为了让设备成功连接我做错了什么。
我尝试将示例中的功能移植到以下文件中的应用程序中:
MainActivity.java
Device.java
StoreReading.java
TakeReading.java
该应用程序位于我的 github 上。 https://github.com/rowmanns/android_ble/tree/master/BloodGlucoseV3
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)
任何帮助/想法将不胜感激!
最佳答案
因此,在一些帮助下,我今天找出了导致此问题的原因。
事实证明,bindService() 默默地失败了。
bindService(new Intent(this, RBLService.class), mServiceConnection, BIND_AUTO_CREATE);
这是因为我没有在 list 文件中列出 RBLService。 (我的一个简单的新手错误......)
一旦此服务在 list 文件中列出,它就会按预期工作。
service
android:name="com.fyp.rowan.bloodglucosev3.RBLService"
android:enabled="true" />
关于java - Android BLE 无法正确连接到设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43719385/
这个问题已经有答案了: How to do case insensitive string comparison? (23 个回答) 已关闭 3 年前。 用户在我的输入栏中写入“足球”,然后执行第 6
啊,不习惯 javascript 中的字符串。 character_id= + id + correct= + correctOrIncorrect 这就是我需要制作成字符串的内容。如果您无法猜测字符
$(function() { var base_price = 0; CalculatePrice(); $(".math1").on('change', function(e) { Calc
我找不到任何文章回答问题:将Spinnaker部署到Spinnaker将管理的同一Kubernetes集群是否安全/正确?我主要是指生产,HA部署。 最佳答案 我认为Spinnaker和Kuberne
我正在使用MSVC在Windows上从源代码(官方源代码发布,而不是从仓库中)构建Qt5(Qt 5.15.0)。 我正在设置环境。变量,依赖项等,然后运行具有1600万个选项的configure,最后
我需要打印一个包含重复单词的数组。我的数组已经可以工作,但我不知道如何正确计算单词数。我已经知道,当我的索引计数器 (i) 为 49 时,并且当 (i) 想要计数到 50 时,我会收到错误,但我不知道
我正在遵循一个指南,该指南允许 Google map 屏幕根据屏幕尺寸禁用滚动。我唯一挣扎的部分是编写一个代码,当我手动调整屏幕大小时动态更改 True/False 值。 这是我按照说明操作的网站,但
我有一个类“FileButton”。它的目的是将文件链接到 JButton,FileButton 继承自 JButton。子类继承自此以使用链接到按钮的文件做有用的事情。 JingleCardButt
我的 friend 数组只返回一个数字而不是所有数字。 ($myfriends = 3) 应该是…… ($myfriends = 3 5 7 8 9 12). 如果我让它进入 while 循环……整个
这个问题在这里已经有了答案: Is there a workaround to make CSS classes with names that start with numbers valid?
我正在制作一个 JavaScript 函数,当调整窗口大小时,它会自动将 div 的大小调整为与窗口相同的宽度/高度。 该功能非常基本,但我注意到在调整窗口大小时出现明显的“绘制”滞后。在 JS fi
此问题的基本视觉效果可在 http://sevenx.de/demo/bootstrap-carousel/inc.carousel/tabbed-slider.html 获得。 - 如果你想看一看。
我明白,如果我想从函数返回一个字符串文字或一个数组,我应该将其声明为静态的,这样当被调用的函数被返回时,内容就不会“消亡”。 但我的问题是,当我在函数内部使用 malloc 分配内存时会怎样? 在下面
在 mySQL 数据库中存储 true/false/1/0 值最合适(读取数据消耗最少)的数据字段是什么? 我以前使用过一个字符长的 tinyint,但我不确定它是否是最佳解决方案? 谢谢! 最佳答案
我想一次读取并处理CSV文件第一行中的条目(例如打印)。我假设使用Unix风格的\n换行符,没有条目长度超过255个字符,并且(现在)在EOF之前有一个换行符。这意味着它是fgets()后跟strto
所以,我们都知道 -1 > 2u == true 的 C/C++ 有符号/无符号比较规则,并且我有一种情况,我想有效地实现“正确”比较。 我的问题是,考虑到人们熟悉的尽可能多的架构,哪种方法更有效。显
**摘要:**文章的标题看似自相矛盾。 本文分享自华为云社区《Java异常处理:如何写出“正确”但被编译器认为有语法错误的程序》,作者: Jerry Wang 。 文章的标题看似自相矛盾,然而我在“正
我有一个数据框,看起来像: dataDemo % mutate_each(funs(ifelse(. == '.', REF, as.character(.))), -POS) # POS REF
有人可以帮助我使用 VBScript 重新格式化/正确格式化带分隔符的文本文件吗? 我有一个文本文件 ^分界如下: AGREE^NAME^ADD1^ADD2^ADD3^ADD4^PCODE^BAL^A
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我是一名优秀的程序员,十分优秀!