I want to get some specific number random values from ArrayList
final ArrayList<HashMap<String, String>> menuItems = new ArrayList<HashMap<String, String>>();
for (int i = 0; i == 4; i++) {
index = random.nextInt(menuItems.size());
HashMap<String, String> getitem = menuItems.get(index);
System.out.println(getitem.get(KEY_NAME));
}
Nothing is printing out.
Code in loop works if i use it outside loop, but since i need multiple values, i use loop and it doesnt work.
final List<Map<String, String>> menuItems = new ArrayList<Map<String, String>>();