I get this error
android.database.sqlite.SQLiteException: near "%": syntax error: , while compiling: SELECT _id, word, meaning FROM todo WHERE KEY_WORD = +%D9%84
for this
database.query(DATABASE_TABLE, new String[] {
KEY_ROWID, KEY_WORD, KEY_MEANING }, "KEY_WORD = " +word, null, null,
null, null,null);
when word is +%D9%84
You have to escape the SQL query. To do this, use the
selectionArgsfield (right after"KEY_WORD = " +wordin your code). It will replace any?in the selection field with its elements:For more details, read this.