Array Of User Inputed Text
<p>I am trying to get to the point where I have a <code>Input (EditText)</code> box in my Activity where users can input ther names. I need it so each time a name is inputed and the button "Add" is clicked it will save that name into a <code>Array</code> So that I can display them on the screen next to the <code>Input (EditText)</code> but also the user needs the ability to remove the last name they just added to the <code>Array</code> with a button that will appear next to the name once it has been added (so kind of needs to save them maybe?).</p>

<p>Also I need to be able to carry over the <code>Array</code> to the next <code>Activity</code> would I have to make it a global <code>Array</code>?</p>

<p>This is what I have so Far:</p>

<pre><code>public class AddRemove extends Activity {

ArrayList&lt;String&gt; playerList = new ArrayList&lt;String&gt;();
String playerlist[];

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.addremove);

    Button confirm = (Button) findViewById(R.id.confirm);
    confirm.setOnClickListener(new OnClickListener() {   
        public void onClick(View v) {
            final EditText playername = (EditText) findViewById(R.id.userinput);
            String name = playername.getText().toString();
            playerList.add(name); 


    }});

}
}
</code></pre>

<p>And the XML:</p>

<pre><code>&lt;EditText
    android:id="@+id/userinput"
    android:layout_width="190dp"
    android:layout_height="40dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="22dp"
    android:layout_marginTop="95dp"
    android:hint="Enter Name"
     &gt;
    &lt;requestFocus /&gt;
&lt;/EditText&gt;

&lt;Button
    android:id="@+id/confirm"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/userinput"
    android:layout_centerVertical="true"
    android:text="Add" /&gt;
</code></pre>
