如何使用android在数据浏览器解析中设置布尔字段? 我用了put命令,它不起作用。在put命令中,只有字符串字段是输入和对象值,因此它不适用于布尔字段。
查询
ParseQuery<ParseObject> query = ParseQuery.getQuery(username);
query.whereEqualTo("userName", update_user);
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> objects, com.parse.ParseException e) {
if (e == null) {
Log.d("result","success");
objects.get(0).put("fullPermission", true);
objects.get(0).saveInBackground();
} else {
Log.d("score", "Error: " + e.getMessage());
}
}
});
答案 0 :(得分:-1)
您可以使用put
方法轻松设置calss中的布尔字段:
ParseObject yourClass = new ParseObject("YouClassName");
yourClass.put("yourBooleanFieldName", false); // set boolean to false
yourClass.saveInBackground();