我正在尝试更新Windows azure移动服务表中的特定行。
item是对ToDoItem表中一行的引用,该表对其进行了一些更改。
private void updateItem(final ToDoItem item) {
if (mClient == null) {
return;
}
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
mToDoTable.update(item).get();
runOnUiThread(new Runnable() {
public void run() {
if (item.isComplete()) {
mAdapter.remove(item);
}
refreshItemsFromTable();
}
});
} catch (Exception exception) {
createAndShowDialog(exception, "Error");
}
return null;
}
}.execute();
}
我的表格中的脚本是
function update(item, user, request) {
request.execute();
}
我想使用ID选择一行。在运行此代码时,它只是插入一个新行。我必须传递ID,才能更新指定的行。