diff --git a/library/src/main/java/com/patloew/rxwear/transformers/DataEventGetDataMap.java b/library/src/main/java/com/patloew/rxwear/transformers/DataEventGetDataMap.java index 2be9839..ee9665a 100644 --- a/library/src/main/java/com/patloew/rxwear/transformers/DataEventGetDataMap.java +++ b/library/src/main/java/com/patloew/rxwear/transformers/DataEventGetDataMap.java @@ -2,6 +2,7 @@ import com.google.android.gms.wearable.DataEvent; import com.google.android.gms.wearable.DataMap; +import com.google.android.gms.wearable.DataMapItem; import rx.Observable; import rx.functions.Func1; @@ -88,7 +89,7 @@ public Boolean call(DataEvent dataEvent) { return observable.map(new Func1() { @Override public DataMap call(DataEvent dataEvent) { - return DataMap.fromByteArray(dataEvent.getDataItem().getData()); + return DataMapItem.fromDataItem(dataEvent.getDataItem()).getDataMap(); } }); } diff --git a/library/src/main/java/com/patloew/rxwear/transformers/DataItemGetDataMap.java b/library/src/main/java/com/patloew/rxwear/transformers/DataItemGetDataMap.java index 67f99f8..79e11af 100644 --- a/library/src/main/java/com/patloew/rxwear/transformers/DataItemGetDataMap.java +++ b/library/src/main/java/com/patloew/rxwear/transformers/DataItemGetDataMap.java @@ -2,6 +2,7 @@ import com.google.android.gms.wearable.DataItem; import com.google.android.gms.wearable.DataMap; +import com.google.android.gms.wearable.DataMapItem; import rx.Observable; import rx.functions.Func1; @@ -65,7 +66,7 @@ public Boolean call(DataItem dataItem) { return observable.map(new Func1() { @Override public DataMap call(DataItem dataItem) { - return DataMap.fromByteArray(dataItem.getData()); + return DataMapItem.fromDataItem(dataItem).getDataMap(); } }); }