Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Keep looping until we've reached the end of the list (which means keep looping
- // as long as the current index position is less than the length of the list).
- // The index variable keeps track of our current position in the list and
- // increments by 1 each time the code in the loop is executed.
- for (int index = 0; index < words.size(); index++) {
- // Create a new TextView
- TextView wordView = new TextView(this);
- // Set the text to be word at the current index
- wordView.setText(words.get(index));
- // Add this TextView as another child to the root view of this layout
- rootView.addView(wordView);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement