Hashmap only saving the last item
<p>I'm getting multiple values from an ArrayList and saving them in a variable:</p>

<p><strong>For each code:</strong></p>

<pre><code> static ArrayList&lt;HashMap&lt;String, String&gt;&gt; test = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();

    for (RoomHandler roomHandler : roomHandlerArrayList) {

        HashMap&lt;String, String&gt; item = new HashMap&lt;String, String&gt;();

        item.put(ROOM_ID, Integer.toString(roomHandler.getRoomID()));

        item.put(ROOM_NAME, roomHandler.getRoomName());

        test.add(item);

    }
</code></pre>

<p>And I'm calling these variables on my adapter. But when I try to print both variables, I only get the ROOM_NAME variable, when I print the ROOM_ID, I get the ROOM_NAME value, which it means that the last value is being recorded twice.</p>

<p><strong>Adapter code:</strong></p>

<pre><code>String getRoomName = (String) ((Map) getItem(position))
        .get(RoomsActivity.ROOM_NAME);

String getRoomID = (String) ((Map) getItem(position))
        .get(RoomsActivity.ROOM_ID);

roomName.setText(getRoomName + getRoomID); //prints ROOM_NAME + ROOM_NAME
</code></pre>

<p>What am I doing wrong?</p>