public void LostNameCallback(String busName) { Log.e("SimpleClient", String.format("Lost name %s", busName)); for (int i = 0; i < busNameItemAdapter.getCount(); ++i) { BusNameItem item = busNameItemAdapter.getItem(i); if (busName.equals(item.getBusName())) { Message msg = handler.obtainMessage(0); msg.arg1 = BUSNAMEITEM_LOST; msg.obj = item; handler.sendMessage(msg); break; } } }
public void DisconnectCallback(int sessionId) { Log.e("SimpleClient", String.format("Disconnect session %d", sessionId)); for (int i = 0; i < busNameItemAdapter.getCount(); ++i) { BusNameItem item = busNameItemAdapter.getItem(i); Log.e( "SimpleClient", String.format("item.id=%d, sessionId=%d", item.getSessionId(), sessionId)); if (item.getSessionId() == sessionId) { Message msg = handler.obtainMessage(0); msg.arg1 = BUSNAMEITEM_DISCONNECT; msg.obj = item; handler.sendMessage(msg); break; } } }