mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Use query conditions for the name lookup :D
This commit is contained in:
parent
29ebce5ab0
commit
308b28dd23
1 changed files with 4 additions and 7 deletions
|
|
@ -238,15 +238,12 @@ 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;
|
||||
}
|
||||
return cat;
|
||||
}
|
||||
|
||||
// Newly used category...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue