On account of being utlizando the same codes ("cod", "value") to include values in the HashMap, my listView is always showing the last item inserted.
As you are creating HashMap
object out of for loop
, and adding values to that object only in the for loop,hence the previous values get erased and you get only last values.
To solve this you need to create the HashMap
object in for loop
corresponding to each row.
Try
HashMap<String, String> temp = null;
for(TechCharacteristic strAux : arrayTechChar)
{
temp = new HashMap<String,String>();
temp.put("cod", strAux.getTechCharacteristic() + " - " + strAux.getTechCharacteristicName());
temp.put("value", strAux.getTechCharacteristicValue());
list.add(temp);
}