database---query中selection用法和selectionArgs用法
public doQuery(long id, final String name) {
mDb.query("some_table", // table name
null, // columns
"id=" + id + " AND name='" + name + "'",
// selection //...... 更多参数省略
);
}
public void doQuery(long id, final String name) {
mDb.query("some_table", // table name
null, // columns
"id=" + id + " AND name=?", // selection
new String[] {name},
//selectionArgs //...... 更多参数省略
);
// ...... 更多代码
}