當前位置: 首頁>>代碼示例>>Java>>正文


Java DataApi.DeleteDataItemsResult方法代碼示例

本文整理匯總了Java中com.google.android.gms.wearable.DataApi.DeleteDataItemsResult方法的典型用法代碼示例。如果您正苦於以下問題:Java DataApi.DeleteDataItemsResult方法的具體用法?Java DataApi.DeleteDataItemsResult怎麽用?Java DataApi.DeleteDataItemsResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.wearable.DataApi的用法示例。


在下文中一共展示了DataApi.DeleteDataItemsResult方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deleteDataItems

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
/**
 * Deletes a data items asynchronously. Caller can specify a {@link ResultCallback} or
 * pass a {@code null}; if a {@code null} is passed, a default {@link ResultCallback} will be
 * used that would call {@link DataConsumer#onDeleteDataItemsResult(int)}.
 */
public void deleteDataItems(final Uri dataItemUri,
        @Nullable final ResultCallback<? super DataApi.DeleteDataItemsResult> callback) {
    assertApiConnectivity();
    Wearable.DataApi.deleteDataItems(mGoogleApiClient, dataItemUri).setResultCallback(
            new ResultCallback<DataApi.DeleteDataItemsResult>() {
                @Override
                public void onResult(DataApi.DeleteDataItemsResult deleteDataItemsResult) {
                    int statusCode = deleteDataItemsResult.getStatus().getStatusCode();
                    if (!deleteDataItemsResult.getStatus().isSuccess()) {
                        Log.e(TAG, String.format(
                                "Failed to delete data items (status code=%d): %s",
                                statusCode, dataItemUri));
                    }
                    if (callback == null) {
                        for (DataConsumer consumer : mDataConsumers) {
                            consumer.onDeleteDataItemsResult(statusCode);
                        }
                    } else {
                        callback.onResult(deleteDataItemsResult);
                    }
                }
            });
}
 
開發者ID:csarron,項目名稱:GmsWear,代碼行數:29,代碼來源:GmsWear.java

示例2: onResult

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
@Override
public void onResult(DataApi.DeleteDataItemsResult deleteDataItemsResult) {
    if (!deleteDataItemsResult.getStatus().isSuccess()) {
        Log.e(TAG, "dismissWearableNotification(): failed to delete DataItem");
    }
    mGoogleApiClient.disconnect();
}
 
開發者ID:CactusSoft,項目名稱:zabbkit-android,代碼行數:8,代碼來源:NotificationUpdateService.java

示例3: deleteDataItemsSynchronous

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
/**
 * Deletes a data items <b>synchronously</b>. This should
 * only be called on a non-UI thread. A {@code timeoutInMillis} is required to specify the
 * maximum length of time, in milliseconds, that the thread should be blocked.
 */
public DataApi.DeleteDataItemsResult deleteDataItemsSynchronous(final Uri dataItemUri,
        long timeoutInMillis) {
    assertApiConnectivity();
    WearUtil.assertNonUiThread();
    return Wearable.DataApi.deleteDataItems(mGoogleApiClient, dataItemUri)
            .await(timeoutInMillis, TimeUnit.MILLISECONDS);
}
 
開發者ID:csarron,項目名稱:GmsWear,代碼行數:13,代碼來源:GmsWear.java

示例4: sendEmptyAcceleroMessage

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
public static PendingResult<DataApi.DeleteDataItemsResult> sendEmptyAcceleroMessage(GoogleApiClient googleApiClient) {
    PendingResult<DataApi.DeleteDataItemsResult> pendingResult = null;
    if (acceleroMessageUri != null) {
        pendingResult = Wearable.DataApi.deleteDataItems(googleApiClient, acceleroMessageUri);
    }

    return pendingResult;
}
 
開發者ID:Parrot-Developers,項目名稱:DronesWear,代碼行數:9,代碼來源:Message.java

示例5: sendEmptyJoystickMessage

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
public static PendingResult<DataApi.DeleteDataItemsResult> sendEmptyJoystickMessage(GoogleApiClient googleApiClient) {
    PendingResult<DataApi.DeleteDataItemsResult> pendingResult = null;

    if (joystickMessageUri != null) {
        pendingResult = Wearable.DataApi.deleteDataItems(googleApiClient, joystickMessageUri);
    }

    return pendingResult;
}
 
開發者ID:Parrot-Developers,項目名稱:DronesWear,代碼行數:10,代碼來源:Message.java

示例6: emptyActionMessage

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
public static PendingResult<DataApi.DeleteDataItemsResult> emptyActionMessage(GoogleApiClient googleApiClient) {
    PendingResult<DataApi.DeleteDataItemsResult> pendingResult = null;
    if (actionMessageUri != null) {
        pendingResult = Wearable.DataApi.deleteDataItems(googleApiClient, actionMessageUri);
    }

    return pendingResult;
}
 
開發者ID:Parrot-Developers,項目名稱:DronesWear,代碼行數:9,代碼來源:Message.java

示例7: onConfigurationDeleted

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
/**
 * Synchronizes the UART configurations between handheld and wearables.
 * Call this when configuration has been deleted.
 * @return pending result
 */
public PendingResult<DataApi.DeleteDataItemsResult> onConfigurationDeleted(final long id) {
	if (mGoogleApiClient == null || !mGoogleApiClient.isConnected())
		return null;
	return Wearable.DataApi.deleteDataItems(mGoogleApiClient, id2Uri(id));
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:11,代碼來源:UARTConfigurationSynchronizer.java

示例8: onResult

import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
@Override
public void onResult(DataApi.DeleteDataItemsResult deleteDataItemsResult) {

}
 
開發者ID:oscarbujinkan,項目名稱:Go-Ubiquitous,代碼行數:5,代碼來源:WearListenerService.java


注:本文中的com.google.android.gms.wearable.DataApi.DeleteDataItemsResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。