我已尝试过stackoverflow的一些答案,但我仍然收到错误......请有人告诉我问题和解决方案是什么......
public Cursor getSearchCursor(String query) {
// TODO Auto-generated method stub
Cursor cd = notifdb.query(TABLE_NOTIFS, allColumns, COLUMN_NOTIF
+ " LIKE '%" + query + "%'", null, null, null, null);
return cd;
}
答案 0 :(得分:0)
试试这种格式......
public Cursor getSearchCursor(String query) {
return db.query(true, DB_TABLE, new String[] { KEY_ROWID, KEY_COLUMN1}, KEY_COLUMN1 + " LIKE" + "'%" + query + "%'",
null, null, null, null, null);
}