mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +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(
|
Cursor cursor = getActivity().getContentResolver().query(
|
||||||
CategoryContentProvider.BASE_URI,
|
CategoryContentProvider.BASE_URI,
|
||||||
Category.Table.ALL_FIELDS,
|
Category.Table.ALL_FIELDS,
|
||||||
null,
|
Category.Table.COLUMN_NAME + "=?",
|
||||||
new String[] {},
|
new String[] {name},
|
||||||
null);
|
null);
|
||||||
// fixme move to conditions
|
if (cursor.moveToNext()) {
|
||||||
while (cursor.moveToNext()) {
|
|
||||||
Category cat = Category.fromCursor(cursor);
|
Category cat = Category.fromCursor(cursor);
|
||||||
if (cat.getName().equals(name)) {
|
return cat;
|
||||||
return cat;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Newly used category...
|
// Newly used category...
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue