I am writing an application on Android Studio. Through the code at the press of a button, additional fields are added to the post.
In the loop, I get values ββfrom dynamically added fields. Question: how to put all the fields in a variable to use it in the future?
String[] items = new String[allEds.size()]; //Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΡΠ΅Π½ΠΈΠ΅ Π²ΡΠ΅Ρ
Π΅Π»Π΅ΠΌΠ΅Π½ΡΠΎΠ² ΡΡΠΎΠ³ΠΎ ΡΠΏΠΈΡΠΊΠ° ΠΈ Π·Π°ΠΏΠΈΡΡ Π² ΠΌΠ°ΡΡΠΈΠ² for (int i = 0; i < allEds.size(); i++) { String strNamePers = (items[i] = ((EditText) allEds.get(i).findViewById(R.id.perona1)).getText().toString()); String strNameVoz = (items[i] = ((EditText) allEds.get(i).findViewById(R.id.peronavoz2)).getText().toString()); String strNameTreb = (items[i] = ((EditText) allEds.get(i).findViewById(R.id.peronatreb3)).getText().toString()); String strNameInt = (items[i] = ((EditText) allEds.get(i).findViewById(R.id.peronasumm4)).getText().toString()); String hr="<hr>"; String br = "<br>"; fnlstr = (br +"Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΠΏΠ΅ΡΡΠΎΠ½Π°ΠΆΠ°: " + strNamePers + br+"Π²ΠΎΠ·ΡΠ°ΡΡ: "+strNameVoz+br+"ΡΡΠ΅Π±ΠΎΠ²Π°Π½ΠΈΡ ΠΊ ΡΠΈΠΏΠ°ΠΆΡ: "+strNameTreb+br+"Π‘ΡΠΌΠΌΠ° ΠΎΠΏΠ»Π°ΡΡ"+strNameInt+br+hr); Log.d("mylog", "ΠΌΠ°ΡΠΈΠ² Ρ ΠΏΠΎΠ»Π΅ΠΉ " + fnlstr); } The problem is that the variable fnlstr stores only the value of the last iteration of the loop. How to make all iterations add up to one line and enter the fnlstr variable?