I'm creating a new object that takes a string and a class. Let's say I have a class called "Quiz.java". What works:
headerItem = new TreeFieldItem(new QuizMenuItem(key, Quiz.class));
My "value" String returns as "Quiz". How do I make this work?
private ArrayList<TreeFieldItem> getListItems() {
ArrayList<TreeFieldItem> arrayList = new ArrayList<TreeFieldItem>(14);
TreeFieldItem headerItem = null;
Map<String, String> map = getMenuItems(R.xml.xml_quiz_menu);
for (Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
**headerItem = new TreeFieldItem(new QuizMenuItem(key, value.class));**
arrayList.add(headerItem);
}
return arrayList;
}