title: EditText input into array
body: <p>I have an input box (EditText1) 
  1. that i want to keep adding values and save them to an Array
  2.  then when am done, i can click the done button and it can take me to the next screen and I can display the values or call the values of the array.. this is what i have so far 
  1. Done Button Works
  2. Add more button and storing to array doesn't quite work....HELP PLZ,</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT :</strong>
  Here is the edited code:</p>
  
  <pre><code>private EditText txt1;
  public static ArrayList&lt;String&gt; playerList = new ArrayList&lt;String&gt;();
  String playerlist[];
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.screen2);
  
      // edittext1 or textview1
      txt1 = (EditText) findViewById(R.id.editText1);
       final String ag = txt1.getText().toString();
  
  
  
          //add more items button
      Button more = (Button) findViewById(R.id.button1);
      more.setOnClickListener(new View.OnClickListener() {
          public void onClick(View view){
              if(txt1.getText().length() != 0){
                                       playerList.add(ag);
                              DisplayToast("Current Players" + playerList);
  
              Intent myIntent = new Intent(view.getContext(),
                      Screen2.class);
               myIntent.putExtra("playerList",playerList);
                  startActivity(myIntent);
  
              }
  
          }});
      }
      //display message 
      private &lt;Strg&gt; String DisplayToast(String ag) {
          Toast.makeText(getBaseContext(), ag, Toast.LENGTH_LONG)
                  .show();
          return ag;
      }}
  </code></pre>