Use query conditions for the name lookup :D

This commit is contained in:
Brion Vibber 2013-04-24 08:01:17 -07:00
parent 29ebce5ab0
commit 308b28dd23

View file

@ -238,16 +238,13 @@ public class CategorizationFragment extends SherlockFragment{
Cursor cursor = getActivity().getContentResolver().query(
CategoryContentProvider.BASE_URI,
Category.Table.ALL_FIELDS,
null,
new String[] {},
Category.Table.COLUMN_NAME + "=?",
new String[] {name},
null);
// fixme move to conditions
while (cursor.moveToNext()) {
if (cursor.moveToNext()) {
Category cat = Category.fromCursor(cursor);
if (cat.getName().equals(name)) {
return cat;
}
}
// Newly used category...
Category cat = new Category();