Fix sql query

This commit is contained in:
alex 2018-03-27 11:32:08 +03:00
parent b8f50b78d8
commit aca26438db

View file

@ -65,8 +65,8 @@ public class WikivoyageDbHelper {
SQLiteConnection conn = openConnection();
if (conn != null) {
try {
String dbQuery = SEARCH_TABLE_SELECT + " WHERE " + SEARCH_COL_SEARCH_TERM + " LIKE " + "'%" + searchQuery + "%'";
SQLiteCursor cursor = conn.rawQuery(dbQuery, null);
String dbQuery = SEARCH_TABLE_SELECT + " WHERE " + SEARCH_COL_SEARCH_TERM + " LIKE ?";
SQLiteCursor cursor = conn.rawQuery(dbQuery, new String[]{"%" + searchQuery + "%"});
if (cursor.moveToFirst()) {
do {
res.add(readSearchResult(cursor));