Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void putData(List<ObjStationData> results) {
- if (results != null && results.size() > 0) {
- PutDataMapRequest putDataMapRequest = PutDataMapRequest.create(Constants.GET_NEAREST_DART);
- DataMap dataMap = putDataMapRequest.getDataMap();
- StationDataResponse objStationDataListSerializable = new StationDataResponse();
- objStationDataListSerializable.setObjStationDataList(results);
- byte[] data = SerializationUtils.serialize(objStationDataListSerializable);
- dataMap.putByteArray(Constants.STATION_DATA_LIST, data);
- dataMap.putString(Constants.STATION_NAME, mClosestStationName);
- Wearable.DataApi.putDataItem(mGoogleApiClient, putDataMapRequest.asPutDataRequest()).setResultCallback(new ResultCallback<DataApi.DataItemResult>() {
- @Override
- public void onResult(DataApi.DataItemResult dataItemResult) {
- }
- });
- } else {
- sendMessage(Constants.NO_DARTS_AVAILABLE, mClosestStationName);
- }
- stopSelf();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement