Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // Keep looping until we've reached the end of the list (which means keep looping
  2. // as long as the current index position is less than the length of the list).
  3. // The index variable keeps track of our current position in the list and
  4. // increments by 1 each time the code in the loop is executed.
  5. for (int index = 0; index < words.size(); index++) {
  6. // Create a new TextView
  7. TextView wordView = new TextView(this);
  8.  
  9. // Set the text to be word at the current index
  10. wordView.setText(words.get(index));
  11.  
  12. // Add this TextView as another child to the root view of this layout
  13. rootView.addView(wordView);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement