Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

您好,请教两个小问题。 #7

Open
EmilyCYY opened this issue Jun 22, 2016 · 2 comments
Open

您好,请教两个小问题。 #7

EmilyCYY opened this issue Jun 22, 2016 · 2 comments

Comments

@EmilyCYY
Copy link

一个是断开连接,liteBluetooth.closeBluetoothGatt();不知道调用的时机是?我在onDestroy中调用总会报“Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.BluetoothGatt.close()' on a null object reference”这个错误。

一个是刷新cache,不好意想问下这个作用是?我也有尝试调用过,也会报空指针的错误。

还望赐教,谢谢!!

@changfeifan
Copy link

runOnUiThread(new Runnable() {
@OverRide
public void run() {
BleLog.i(TAG, "Notification descriptor failure : " + exception);
bleExceptionHandler.handleException(exception);
}
});
所有这种回调都需要在主线程上进行。它封装的回调会异步的方式返回。回来的数据是在子线程上的。
@EmilyCYY

@EmilyCYY
Copy link
Author

@changfeifan 谢谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants