本文整理匯總了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);
}
}
});
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例8: onResult
import com.google.android.gms.wearable.DataApi; //導入方法依賴的package包/類
@Override
public void onResult(DataApi.DeleteDataItemsResult deleteDataItemsResult) {
}