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() {
|
deviceListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView parent, View v, int position, long id) {
|
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);
|
Intent startIntent = new Intent(ControlCenter.this, AppManagerActivity.class);
|
||||||
startActivity(startIntent);
|
startActivity(startIntent);
|
||||||
} else {
|
} else {
|
||||||
|
@ -163,7 +163,7 @@ public class ControlCenter extends Activity {
|
||||||
private void refreshPairedDevices() {
|
private void refreshPairedDevices() {
|
||||||
GBDevice connectedDevice = null;
|
GBDevice connectedDevice = null;
|
||||||
for (GBDevice device : deviceList) {
|
for (GBDevice device : deviceList) {
|
||||||
if (device.getState() == GBDevice.State.CONNECTED) {
|
if (device.isConnected()) {
|
||||||
connectedDevice = device;
|
connectedDevice = device;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue