Android App Inventor - Using "List From CSV ROW" to populate a ListPicker (Drop-down List)

Recently I was asked to teach a class on Android Programming with the end-goal of them writing a simple game. As they were young students with experience in Scratch ( I used App Inventor ( because of its similarities - and because teaching Java / Android would have taken too long.

The game I chose for them was hangman, and one of the immediate problems was how to enter a letter. There are text boxes, but thats a little ugly. I could have put 26 buttons on the screen, but that requires each button to be placed and coded individually which would be a nightmare (one glaring ommission from App Inventor is the ability to generate buttons dynamically - the UI must be created separately). So I chose to use a ListPicker (a drop down list). Now the problem of populating it came up. I could have 26 manual element adds, which seemed excessive... so I looked at the options - one of which is ElementsFromString - brilliant! Just what I need... if it worked... which it didn't. I have no idea why, but it didn't do anything.

After trying a few different things I came up with something that worked - albeit a little OTT for my liking. "List From CSV Row". The documentation was a little vague, and it doesn't work with just a comma-separated list - I discovered almost by accident that it needs a line break on the end for the ListPicker to actually populate correctly. This is the working code block:

--pic to come - sorry, using a work PC that only has IE on it and none of the buttons on the editor work... typical! --

In essence the text box should have "A, B, C, ... , X, Y, Z\n", and that should be plugged into a List From CSV Row block, which in turn should be plugged into a "Set ListPicker.Elements" block.

I hope this helps someone because it drove me nuts for a while until I got it working.