There is such a construction
String[] massiv = { getResources().getString(R.info),"4432"}; ArrayList<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>(massiv.length); HashMap<String, Object> map; for (int i = 0; i < massiv.length; i++) { map = new HashMap<String, Object>(); map.put("key", massiv[i]); data.add(map); } Everything works, but I don’t understand how to add an element to massiv programmatically, theoretically, from other classes, so that it massiv through a cycle. Well, for example, you click on the button, the event picks up some string, and throws it into massiv and the loop goes through it. With add, you can only refer to ArrayList, but on the other hand there is a massiv.length condition. I hope you understand what I mean?