1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-19 03:20:21 +02:00

use isConnected() rather than getState() == CONNECTED

because getState() == INITIALIZED implies CONNECTED
This commit is contained in:
cpfeiffer 2015-04-19 15:53:43 +02:00
parent 40c76fcabf
commit 54784100b8

View File

@ -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;
}
}