title: Android adapter.add() crashing my application
body: <p>in android application, i'm filling my spinner with some data coming from EditText object.
  And when i'm trying  to add it with adapter.add(somestring) method it crashes, so i need help.
  ...here's the code</p>
  
  <pre><code>public class OptionsMenu extends Activity implements View.OnClickListener{
  
      Spinner users;
      EditText input;
      Button add,remove;
  
      public static String filename = "savedData";
      SharedPreferences sharedData;
      String stringUsers;
  
     ArrayAdapter&lt;CharSequence&gt; adapter;
  
     public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.options_menu);
  
          Create();
          sharedData = getSharedPreferences(filename, 0);    
     }
  
  private void Create() {
      // TODO Auto-generated method stub
      users = (Spinner) findViewById(R.id.sp_op_users);
      input = (EditText) findViewById(R.id.tb_op_inputUsers);
      add = (Button) findViewById(R.id.bt_op_add);
      remove = (Button) findViewById(R.id.bt_op_remove);
  
      add.setOnClickListener(this);
      remove.setOnClickListener(this);
  
      //------------ADAPTER-----------------  
      adapter = ArrayAdapter.createFromResource(this, R.array.users,
                          android.R.layout.simple_spinner_item);
      adapter.setDropDownViewResource(
                  android.R.layout.simple_spinner_dropdown_item);
  
      users.setAdapter(adapter);
  }
  
  public void onClick(View v) {
      // TODO Auto-generated method stub
      switch(v.getId())
      {
          case R.id.bt_op_add:
              if (!input.getText().toString().equals("")) {
                  CharSequence inputData = input.getText().toString();
                  adapter.add(inputData);
  
                  adapter.notifyDataSetChanged();
                  users.setAdapter(adapter);
              }
              input.setText("");
              users.setSelection(Adapter.NO_SELECTION);
              break;
          case R.id.bt_op_remove:
              break;
      }
  }   
  </code></pre>