本文整理匯總了Java中com.google.android.gms.wearable.DataMap.putStringArrayList方法的典型用法代碼示例。如果您正苦於以下問題:Java DataMap.putStringArrayList方法的具體用法?Java DataMap.putStringArrayList怎麽用?Java DataMap.putStringArrayList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.wearable.DataMap
的用法示例。
在下文中一共展示了DataMap.putStringArrayList方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sendWearTreatmentsDataDelete
import com.google.android.gms.wearable.DataMap; //導入方法依賴的package包/類
public static boolean sendWearTreatmentsDataDelete(List<String> list) {
if (googleApiClient != null && !googleApiClient.isConnected() && !googleApiClient.isConnecting()) {
googleApiClient.connect();
}
if (googleApiClient != null) {
if (!list.isEmpty()) {
Log.d(TAG, "sendWearTreatmentsDataDelete graph size=" + list.size());
DataMap entries = new DataMap();
entries.putLong("time", new Date().getTime()); // MOST IMPORTANT LINE FOR TIMESTAMP
entries.putString("action", "delete");
entries.putStringArrayList("entries", (new ArrayList<String>(list)));
new SendToDataLayerThread(WEARABLE_TREATMENTS_DATA_PATH, googleApiClient).executeOnExecutor(xdrip.executor, entries);
}
else
Log.d(TAG, "sendWearTreatmentsDataDelete treatments count = 0");
} else {
Log.e(TAG, "sendWearTreatmentsData No connection to wearable available for send treatment!");
return false;
}
return true;
}