How to create a list in Java Android
of the type dictionary that is to say that content can be stored clave:valor
, the key and its value are String
.
Update 1
I have done the following:
Map<String, String> listParams = new HashMap<String, String>();
To add parameters:
listParams.put("offset","3");
listParams.put("items","50");
listParams.put("sort","title,asc");
To scroll through all the elements
for(Map.Entry<String, String> entry : listParams) {
String.format("llave: %s, valor: %s", entry.getKey(), entry.getValue());
}
I get the following error
Test.java:37: error: for-each not applicable to expression type for (Map.Entry entry: listParams) { ^ required: array or java.lang.Iterable found: Map 1 error