i developing an app for android wear. Below code with explanation of the problem
if(mGoogleApiClient.isConnected()){
K.i("Always called!");
Wearable.NodeApi.getConnectedNodes(mGoogleApiClient).setResultCallback(new ResultCallback<NodeApi.GetConnectedNodesResult>() {
@Override
public void onResult(NodeApi.GetConnectedNodesResult nodes) {
K.i("Never called :( ");
for (Node node : nodes.getNodes()) {
Wearable.MessageApi.sendMessage(mGoogleApiClient, node.getId(), message, null);
}
}
});
}
UPD: I solve problem by turn off and turn on my phone again (Nexus 5) May be is there easier way to solve problem?
Tried to add .await() and AsyncTask, but result is the same
connect()
(and wait foronConnected()
) on mGoogleApiClient? – Seagoing