I am using contents in one ArrayList(String) to be used to update another ArrayList(EditText). I want to loop through the String array, get its detail and use it to setText for each corresponding EditText in the ArrayList(EditText).
So String at index 0 will be used to edit EditText at index 0 and so on. I was trying to use a double For loop but it ends filing all the EditTexts as "quantity". I understand why, but is there even a way to loop through this to do this? Or I need to find a different method?
ArrayList<String> detailArray = new ArrayList<>(Arrays.asList(
"category", "name", "brand", "quantity"));
ArrayList<EditText> emptyFields = new ArrayList<>(Arrays.asList(
category, name, brand, quantity));
for(EditText x : emptyFields){
for(String y : detailArray){
x.setText(y);
}
}