Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Get an array with file names of all category images in drawable folder.
- *
- * @return the file names of all catergories in drawable folder.
- */
- public String[] getCategoryDrawables() {
- Field[] fields = R.drawable.class.getFields();
- String[] categoryDrawables = new String[fields.length];
- // Place all category images in the array.
- for (int i = 0; i < categoryDrawables.length; i++) {
- // Iterate through NoteCategories and get the drawables that matches
- // the category names.
- for (NoteCategory category : NoteCategory.values()) {
- if (category.toString().equals(categoryDrawables[i])) {
- categoryDrawables[i] = fields[i].getName();
- }
- }
- }
- return categoryDrawables;
- }
Add Comment
Please, Sign In to add comment