mDb.Query, check for correctness.
I am trying to implement a Search on my listview, based on Simple cursor
adapter and the text watcher technique. I have the following fields in my
Listview:
|ID|Name|Owner|Breed|
I want only one constraint from the user, and if it matches anyone of the
above field my list search narrows down.
So far the query I have prepared is as follows:
String value = "%" + constraint.toString() + "%";
return mDb.query(DBAdapter.DATABASE_TABLE0, asColumnsToReturn,
"Name like ? OR IDno like ? OR Owner like ?",
new String[] { value }, null, null, null);
I want to know if I am doing this right, will my "Name like ? OR IDno like
? OR Owner like ?" work as intended? "value" in the above refers to the
stream I get from the Edit Text box in which the user enters.
No comments:
Post a Comment