All im trying to do is set it up so that when you click one of the action buttons on the notification it opens a wear activity ive looked up how to do this a bunch over the past day and i keep winding up with the same onconnected: null issue. i cant seem to progress past this problem thanks in advance for any help.
PutDataMapRequest dataMapRequest = PutDataMapRequest.create("/notification");
dataMapRequest.getDataMap().putDouble("timestamp", System.currentTimeMillis());
dataMapRequest.getDataMap().putString("title", "This is the title");
dataMapRequest.getDataMap().putString("content", "This is a notification with some text.");
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
Wearable.DataApi.putDataItem(mGoogleApiClient, putDataRequest);
About the GoogleApiClient being null at
onConnected
, try callingmGoogleApiClient.connect()
at onStart andmGoogleApiClient.disconnect()
at onStop, as adviced in the documentation.If you have used
enableAutoManage
, also remove it as in this post.