package com.example.android.miwok;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;

public class NumbersActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_numbers);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        //Create a String array with 10 indices containing the words for the numbers 1-10
        String words[] = new String[10];
        words[0] = "one";
        words[1] = "two";
        words[2] = "three";
        words[3] = "four";
        words[4] = "five";
        words[5] = "six";
        words[6] = "seven";
        words[7] = "eight";
        words[8] = "nine";
        words[9] = "ten";

        // Log messages to check that the array has been initialised correctly
        Log.v("NumbersActivity", "Word at index 0: " + words[0]);
        Log.v("NumbersActivity", "Word at index 1: " + words[1]);
        Log.v("NumbersActivity", "Word at index 1: " + words[2]);
        Log.v("NumbersActivity", "Word at index 1: " + words[3]);
        Log.v("NumbersActivity", "Word at index 1: " + words[4]);
        Log.v("NumbersActivity", "Word at index 1: " + words[5]);
        Log.v("NumbersActivity", "Word at index 1: " + words[6]);
        Log.v("NumbersActivity", "Word at index 1: " + words[7]);
        Log.v("NumbersActivity", "Word at index 1: " + words[8]);
        Log.v("NumbersActivity", "Word at index 1: " + words[9]);

    }

}

@@ -172,16 +172,45 @@
 l.Log;%0A%0A
+import java.util.ArrayList;%0A%0A
 public c
@@ -550,37 +550,19 @@
 te a
- String array with 10 indices
+n ArrayList
  con
@@ -612,39 +612,57 @@
     
+ArrayList%3C
 String
+%3E
  words
-%5B%5D
  = new 
+ArrayList%3C
 String
-%5B10%5D
+%3E()
 ;%0A  
@@ -676,19 +676,19 @@
 ords
-%5B0%5D = 
+.add(
 %22one%22
+)
 ;%0A  
@@ -702,19 +702,19 @@
 ords
-%5B1%5D = 
+.add(
 %22two%22
+)
 ;%0A  
@@ -728,21 +728,21 @@
 ords
-%5B2%5D = 
+.add(
 %22three%22
+)
 ;%0A  
@@ -756,20 +756,20 @@
 ords
-%5B3%5D = 
+.add(
 %22four%22
+)
 ;%0A  
@@ -783,20 +783,20 @@
 ords
-%5B4%5D = 
+.add(
 %22five%22
+)
 ;%0A  
@@ -810,19 +810,19 @@
 ords
-%5B5%5D = 
+.add(
 %22six%22
+)
 ;%0A  
@@ -836,21 +836,21 @@
 ords
-%5B6%5D = 
+.add(
 %22seven%22
+)
 ;%0A  
@@ -864,21 +864,21 @@
 ords
-%5B7%5D = 
+.add(
 %22eight%22
+)
 ;%0A  
@@ -892,20 +892,20 @@
 ords
-%5B8%5D = 
+.add(
 %22nine%22
+)
 ;%0A  
@@ -919,19 +919,19 @@
 ords
-%5B9%5D = 
+.add(
 %22ten%22
+)
 ;%0A%0A 
@@ -1072,11 +1072,15 @@
 ords
-%5B0%5D
+.get(0)
 );%0A 
@@ -1118,33 +1118,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B1%5D);
@@ -1142,11 +1142,15 @@
 ords
-%5B1%5D
+.get(1)
 );%0A 
@@ -1188,33 +1188,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B2%5D);
@@ -1212,11 +1212,15 @@
 ords
-%5B2%5D
+.get(2)
 );%0A 
@@ -1258,33 +1258,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B3%5D);
@@ -1282,11 +1282,15 @@
 ords
-%5B3%5D
+.get(3)
 );%0A 
@@ -1328,33 +1328,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B4%5D);
@@ -1352,11 +1352,15 @@
 ords
-%5B4%5D
+.get(4)
 );%0A 
@@ -1398,33 +1398,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B5%5D);
@@ -1422,11 +1422,15 @@
 ords
-%5B5%5D
+.get(5)
 );%0A 
@@ -1468,33 +1468,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B6%5D);
@@ -1492,11 +1492,15 @@
 ords
-%5B6%5D
+.get(6)
 );%0A 
@@ -1538,33 +1538,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B7%5D);
@@ -1562,11 +1562,15 @@
 ords
-%5B7%5D
+.get(7)
 );%0A 
@@ -1608,33 +1608,33 @@
  %22Word at index 
-1
+0
 : %22 + words%5B8%5D);
@@ -1632,11 +1632,15 @@
 ords
-%5B8%5D
+.get(8)
 );%0A 
@@ -1686,17 +1686,17 @@
 t index 
-1
+0
 : %22 + wo
@@ -1702,11 +1702,15 @@
 ords
-%5B9%5D
+.get(9)
 );%0A%0A

Change Array words to ArrayList words