本文整理汇总了Java中com.google.android.gms.wearable.DataMapItem.getDataMap方法的典型用法代码示例。如果您正苦于以下问题:Java DataMapItem.getDataMap方法的具体用法?Java DataMapItem.getDataMap怎么用?Java DataMapItem.getDataMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.wearable.DataMapItem
的用法示例。
在下文中一共展示了DataMapItem.getDataMap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
LOGD(TAG, "onDataChanged: " + dataEvents + " for " + getPackageName());
for (DataEvent event : dataEvents) {
LOGD(TAG, "Uri is: " + event.getDataItem().getUri());
DataMapItem mapItem = DataMapItem.fromDataItem(event.getDataItem());
String path = event.getDataItem().getUri().getPath();
if (event.getType() == DataEvent.TYPE_CHANGED) {
if (PATH_RESPONSE.equals(path)) {
// we have a response
DataMap data = mapItem.getDataMap();
saveFeedback(data);
}
} else if (event.getType() == DataEvent.TYPE_DELETED) {
if (path.startsWith(SessionAlarmService.PATH_FEEDBACK)) {
Uri uri = event.getDataItem().getUri();
dismissLocalNotification(uri.getLastPathSegment());
}
}
}
}
示例2: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
Log.d(TAG, "Data changed");
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(
ConfigurationHelper.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
Log.d(TAG, "Config DataItem updated:" + config);
// This can happen from this method more often when phone changes
updateUiForConfigDataMap(config);
}
}
示例3: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(
WatchFaceUtil.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
Log.d(TAG, "Config DataItem updated:" + config);
updateUiForConfigDataMap(config);
}
}
示例4: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
Log.d(TAG,"onDataChanged "+dataEvents);
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(WatchFaceUtil.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
Log.d(TAG, "Config DataItem updated:" + config);
updateUiForConfigDataMap(config);
}
}
示例5: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onDataChanged(DataEventBuffer dataEventBuffer) {
for (DataEvent dataEvent : dataEventBuffer) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(
DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
Log.d("WatchFace", "Config DataItem updated:" + config);
updateUiForConfigDataMap(config);
}
}
示例6: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(SunsetsWatchFaceUtil.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Config DataItem updated:" + config);
}
updateUiForConfigDataMap(config);
}
}
开发者ID:marcouberti,项目名称:american_sunsets_watch_face,代码行数:21,代码来源:WatchFaceCompanionConfigActivity.java
示例7: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(
SunsetsWatchFaceUtil.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
Log.d(TAG, "Config DataItem updated:" + config);
updateUiForConfigDataMap(config);
}
}
示例8: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
try {
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(
DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Config DataItem updated:" + config);
}
updateUiForConfigDataMap(config);
}
} finally {
dataEvents.close();
}
}
示例9: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
if (!dataItem.getUri().getPath().equals(
DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Config DataItem updated:" + config);
}
updateUiForConfigDataMap(config);
}
}
示例10: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
try {
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
Log.d(TAG, "onDataChanged: Path" + dataItem.getUri().getPath());
if (!dataItem.getUri().getPath().equals(
Constants.PATH_WEATHER_DATA)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Config DataItem updated:" + config);
}
updateUiForConfigDataMap(config);
}
} finally {
dataEvents.close();
}
}
示例11: onDataChanged
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
Log.d(TAG, "onDataChanged: ");
try {
for (DataEvent dataEvent : dataEvents) {
if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
continue;
}
DataItem dataItem = dataEvent.getDataItem();
Log.d(TAG, "path: " + dataItem.getUri().getPath());
if (!dataItem.getUri().getPath().equals(Constants.PATH_WEATHER_DATA)) {
continue;
}
DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
DataMap config = dataMapItem.getDataMap();
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Config DataItem updated:" + config);
}
DigitalWatchFaceUtil.overwriteKeysInConfigDataMap(mGoogleApiClient, config, Constants.PATH_WEATHER_DATA);
}
} finally {
dataEvents.close();
}
}
开发者ID:mladenbabic,项目名称:Advanced_Android_Development_Wear,代码行数:30,代码来源:ConfigDataListenerService.java
示例12: onResult
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onResult(DataApi.DataItemResult dataItemResult) {
if (dataItemResult.getStatus().isSuccess()) {
if (dataItemResult.getDataItem() != null) {
DataItem configDataItem = dataItemResult.getDataItem();
DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
DataMap config = dataMapItem.getDataMap();
mCallback.onConfigDataMapFetched(config);
} else {
mCallback.onConfigDataMapFetched(new DataMap());
}
}
}
示例13: onResult
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override
public void onResult(@NonNull DataApi.DataItemResult dataItemResult) {
if (dataItemResult.getStatus().isSuccess()) {
if (dataItemResult.getDataItem() != null) {
DataItem configDataItem = dataItemResult.getDataItem();
DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
DataMap config = dataMapItem.getDataMap();
mCallback.onConfigDataMapFetched(config);
} else {
mCallback.onConfigDataMapFetched(new DataMap());
}
}
}
示例14: onResult
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // ResultCallback<DataApi.DataItemResult>
public void onResult(DataApi.DataItemResult dataItemResult) {
if (dataItemResult.getStatus().isSuccess() && dataItemResult.getDataItem() != null) {
DataItem configDataItem = dataItemResult.getDataItem();
DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
DataMap config = dataMapItem.getDataMap();
Log.d(TAG, "startup setup UI...");
updateUiForConfigDataMap(config);
//setUpAllPickers(config);
} else {
// If DataItem with the current config can't be retrieved, select the default items on
// each picker.
//setUpAllPickers(null);
}
}
示例15: onResult
import com.google.android.gms.wearable.DataMapItem; //导入方法依赖的package包/类
@Override // ResultCallback<DataApi.DataItemResult>
public void onResult(DataApi.DataItemResult dataItemResult) {
if (dataItemResult.getStatus().isSuccess() && dataItemResult.getDataItem() != null) {
DataItem configDataItem = dataItemResult.getDataItem();
DataMapItem dataMapItem = DataMapItem.fromDataItem(configDataItem);
DataMap config = dataMapItem.getDataMap();
Log.d(TAG,"startup setup UI...");
updateUiForConfigDataMap(config);
//setUpAllPickers(config);
} else {
// If DataItem with the current config can't be retrieved, select the default items on
// each picker.
//setUpAllPickers(null);
}
}
开发者ID:marcouberti,项目名称:american_sunsets_watch_face,代码行数:16,代码来源:WatchFaceCompanionConfigActivity.java