I am trying to read data from Firebase Database through the .getData() as seen in my code and then adding it to an Array. When debugging the code below I can see that the assigned values in the Database can be read, however it's being appended but not saved in the array, (list : Array < String >). I am expecting seven string values in the array, but when the code is executed the array contains zero strings. I have tried hardcoding in string values to the .append but even "Bread" doesn't get saved in the end. If any further information is needed, let me know. Help would be much appreciated, thanks in beforehand!
Shows the list doesn't save the added values
Shows that the values can be read from Firebase Database and added to the list