からいくつかのランダムな値を選択する必要がありArrayList
ますが、値は複製できません。以下のコードでは、ランダムな値を選択するだけですが、重複する可能性があります。
for (int i = 0; i < 5; i++) {
index = random.nextInt(menuItems.size());
HashMap<String, String> urls = new HashMap<String, String>();
urls.put("Value", menuItems.get(index).get(KEY_URL));
randomitems.add(urls);
}