You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
Hi, I am using the DeviceList Activity in order to choose a device. But if I disable the BT, when viewing the DeviceList screen and choose one of the already rendered results, then in my onActivityResult() I get an NPE when trying to connect.
Specifically, in the BluetoothService.java, the ConnectThread's run method, the mmSocket.connect(); line gets a NPE, when executed. Since you already handle the IOException, would it be possible to add another NullPointerException catch block below?
public void run() {
// Always cancel discovery because it will slow down a connection
mAdapter.cancelDiscovery();
// Make a connection to the BluetoothSocket
try {
// This is a blocking call and will only return on a
// successful connection or an exception
mmSocket.connect();
} catch (IOException e) {
// Close the socket
try {
mmSocket.close();
} catch (IOException e2) { }
connectionFailed();
return;
}
// Reset the ConnectThread because we're done
synchronized (BluetoothService.this) {
mConnectThread = null;
}
// Start the connected thread
connected(mmSocket, mmDevice, mSocketType);
}
Thanks!
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I am using the DeviceList Activity in order to choose a device. But if I disable the BT, when viewing the DeviceList screen and choose one of the already rendered results, then in my onActivityResult() I get an NPE when trying to connect.
Specifically, in the BluetoothService.java, the ConnectThread's run method, the
mmSocket.connect();
line gets a NPE, when executed. Since you already handle the IOException, would it be possible to add another NullPointerException catch block below?Thanks!
The text was updated successfully, but these errors were encountered: