本文整理匯總了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