0

MobileServiceTableBase 类型中的方法 delete(Object, TableDeleteCallback) 不适用于参数(JsonObject, List>, new TableDeleteCallback(){})

上面的错误代码。尝试从 Android 应用程序创建或删除 Blob 容器

    public void deleteBlob(final String containerName, String blobName) {
    //Create the json Object we'll send over and fill it with the required
    //id property - otherwise we'll get kicked back
    JsonObject blob = new JsonObject();     
    blob.addProperty("id", 0);
    //Create parameters to pass in the blob details.  We do this with params
    //because it would be stripped out if we put it on the blob object
    List<Pair<String,String>> parameters = new ArrayList<Pair<String, String>>();
    parameters.add(new Pair<String, String>("containerName", containerName));
    parameters.add(new Pair<String, String>("blobName", blobName));     
    mTableBlobs.delete(blob, parameters, new TableDeleteCallback() {            
        @Override
        public void onCompleted(Exception exception, ServiceFilterResponse response) {
            if (exception != null) {
                Log.e(TAG, exception.getCause().getMessage());
                return;
            }
            //Refetch the blobs from the server
            getBlobsForContainer(containerName);
        }
    });
}
4

1 回答 1

0

错误消息指出delete()应该使用 2 个参数调用该方法,而您传递了 3 个参数,这就是它无法编译的原因。

于 2013-05-07T08:54:30.637 回答