mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-24 02:46:50 +01:00
use isConnected() rather than getState() == CONNECTED
because getState() == INITIALIZED implies CONNECTED
This commit is contained in:
parent
40c76fcabf
commit
54784100b8
@ -81,7 +81,7 @@ public class ControlCenter extends Activity {
|
||||
deviceListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView parent, View v, int position, long id) {
|
||||
if (deviceList.get(position).getState() == GBDevice.State.CONNECTED) {
|
||||
if (deviceList.get(position).isConnected()) {
|
||||
Intent startIntent = new Intent(ControlCenter.this, AppManagerActivity.class);
|
||||
startActivity(startIntent);
|
||||
} else {
|
||||
@ -163,7 +163,7 @@ public class ControlCenter extends Activity {
|
||||
private void refreshPairedDevices() {
|
||||
GBDevice connectedDevice = null;
|
||||
for (GBDevice device : deviceList) {
|
||||
if (device.getState() == GBDevice.State.CONNECTED) {
|
||||
if (device.isConnected()) {
|
||||
connectedDevice = device;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user