Deleting a Bucket

You can delete a bucket by calling the delete() method of the KiiBucket class. All KiiObjects in the bucket will be deleted accordingly.

Here is the sample code showing how you can delete a bucket:

  • KiiBucket bucket = Kii.bucket("_BUCKET_NAME");
    try {
      bucket.delete();
    } catch (AppException e) {
      // Handle the error.
    } catch (IOException e) {
      // Handle the error.
    }
  • KiiBucket bucket = Kii.bucket("_BUCKET_NAME");
    bucket.delete(new KiiBucketCallBack<KiiBucket>() {
      @Override
      public void onDeleteCompleted(int token, Exception e) {
        if (e != null) {
          Log.v("BucketDelete", "delete failed: "+e.getLocalizedMessage());
          return;
        }
        Log.v("BucketDelete", "delete successful");
      }
    });