Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Category getCategory(int categoryId) {
- Cursor c = database.query(DBHelper.TABLE_CATEGORY, allColumns,
- DBHelper.KEY_NAME + " = " + categoryId, null,
- null, null, null);
- if (c != null && c.moveToFirst()) {
- category.setId(c.getInt(c.getColumnIndex(DBHelper.KEY_ID)));
- category.setName(c.getString(c.getColumnIndex(DBHelper.KEY_NAME)));
- c.close();
- }
- return category;
- }
Add Comment
Please, Sign In to add comment