public void OnResult(IDataApiDeleteDataItemsResult result)
 {
     if (Log.IsLoggable(MainActivity.TAG, LogPriority.Debug))
     {
         if (result.Status.IsSuccess)
         {
             Log.Debug(MainActivity.TAG, "Successfully deleted data item " + act.dataItemUri);
         }
         else
         {
             Log.Debug(MainActivity.TAG, "Failed to delete data item " + act.dataItemUri);
         }
     }
 }
Example #2
0
        protected override void OnHandleIntent(Android.Content.Intent intent)
        {
            mGoogleApiClient.BlockingConnect(TIME_OUT, TimeUnit.Milliseconds);
            Android.Net.Uri dataItemUri = intent.Data;
            if (Log.IsLoggable(Constants.TAG, LogPriority.Verbose))
            {
                Log.Verbose(Constants.TAG, "DeleteService.OnHandleIntent = " + dataItemUri);
            }
            if (mGoogleApiClient.IsConnected)
            {
                IDataApiDeleteDataItemsResult result = WearableClass.DataApi
                                                       .DeleteDataItems(mGoogleApiClient, dataItemUri).Await().JavaCast <IDataApiDeleteDataItemsResult>();
                if (result.Status.IsSuccess && !intent.GetBooleanExtra(Constants.EXTRA_SILENT, false))
                {
                    // Show the success animaton on the watch unless Silent extra is true.
                    StartConfirmationActivity(ConfirmationActivity.SuccessAnimation, GetString(Resource.String.delete_successful));
                }
                else
                {
                    if (Log.IsLoggable(Constants.TAG, LogPriority.Verbose))
                    {
                        Log.Verbose(Constants.TAG, "DeleteService.OnHandleIntent: Failed to delete dataITem:"
                                    + dataItemUri);
                    }

                    // Show the failure animation on the watch unless Silent extra is true.
                    if (!intent.GetBooleanExtra(Constants.EXTRA_SILENT, false))
                    {
                        StartConfirmationActivity(ConfirmationActivity.FailureAnimation, GetString(Resource.String.delete_unsuccessful));
                    }
                }
            }
            else
            {
                Log.Error(Constants.TAG, "Failed to delete data item: " + dataItemUri +
                          " - Client disconnected from Google Play Services");
                // Show the failure animation on the watch unless Silent extra is true.
                if (!intent.GetBooleanExtra(Constants.EXTRA_SILENT, false))
                {
                    StartConfirmationActivity(ConfirmationActivity.FailureAnimation, GetString(Resource.String.delete_unsuccessful));
                }
            }
            mGoogleApiClient.Disconnect();
        }
			public void OnResult (IDataApiDeleteDataItemsResult result)
			{
				if (Log.IsLoggable (MainActivity.TAG, LogPriority.Debug)) {
					if (result.Status.IsSuccess) {
						Log.Debug (MainActivity.TAG, "Successfully deleted data item " + act.dataItemUri);
					} else {
						Log.Debug (MainActivity.TAG, "Failed to delete data item " + act.dataItemUri);
					}
				}
			}