title: notifyDataSetChanged does not update my List adapter
body: <p>I am trying to dynamically add items to a list adapter using an alert dialog. The item is getting added to the list being used to display, but the list adapter does not change when the new item is added. Here is some of my code:</p>
  
  <pre><code>public class ContactEdit extends Activity implements View.OnClickListener, OnItemSelectedListener
  </code></pre>
  
  <p>{</p>
  
  <pre><code>private Button btnAdd = null;
  
  /**
   * Used as a flag to indicate if the Activity is being used to create a new
   * contact (0) or update an old contact (1).
   */
  public static boolean isEdit = false;
  
  /**
   * The adapter that holds the contacts numbers
   */
  public NumberListAdapter numberListAdapter;
  
  /**
   * A Contact containing all the details of the contact to be edited by this
   * Activity
   */
  private Contact contact = null;
  
  /**
   * This method creates the NewContact activity.
   * 
   * @param i
   *            This Method gets passed the bundle to be created.
   * @see android.app.Activity#onCreate(android.os.Bundle)
   */
  @Override
  public final void onCreate(final Bundle i)
  {
      // Used to temporarily store the nameID passed to this Activity when it
      // is called to
      // edit a contact.
  
      isEdit = false;
  
      try
      {
          super.onCreate(i);
  
          this.setContentView(R.layout.contactedit);
  
          // Add number button
          this.btnAdd = (Button) findViewById(R.id.form_button);
          this.btnAdd.setOnClickListener(ContactEdit.this);
  
          final Bundle extras = this.getIntent().getExtras();
  
          if (extras != null)
          {
              // sets value
              contact = extras.getParcelable(BlackbookUtils.CONTACT);
  
              final List&lt;Number&gt; contactNumbersList = contact.getNumbers();
              ListView numberListView = (ListView) this.findViewById(R.id.numberListView);
              numberListAdapter = new NumberListAdapter(this, R.layout.row, contactNumbersList);
              numberListView.setAdapter(numberListAdapter);
  
              isEdit = true;
  
          }
  
          Log.d(TAG, "new contact oncreate successful");
      }
      catch (Exception e)
      {
          Log.d(TAG, "newcontact oncreate failed");
          e.printStackTrace();
      }
  }
  
  /**
   * This method sets the program to watch for any button or textbox to be
   * pressed.
   * 
   * @param view
   *            This is the current focused item, in this case a textbox.
   * @see android.view.View.OnClickListener#onClick(android.view.View)
   */
  public final void onClick(final View view) // change this to use new delim
  // methods
  {
      try
      {
          if (view == btnAdd)
          {
              //TODO: Guard to check if it is a new contact
              //Add number from the edit text to the list
  
              if (!isEdit)
              {
                  contact = new Contact();
                  numberListAdapter = new NumberListAdapter(this, R.layout.row, contact.getNumbers());
              }
  
              AlertDialog.Builder alert = new AlertDialog.Builder(this);
  
              alert.setTitle("Contact edit");
              alert.setMessage("Add a new number");
  
              // Set an EditText view to get user input 
              final EditText input = new EditText(this);
              alert.setView(input);
  
              alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int whichButton) {
                      Editable value = input.getText();
                      //TODO: This will notify there is a change in the list and reload it
  
                      Number tempNumber = new Number();
                      tempNumber.setphoneNumber(value.toString());
                      contact.getNumbers().add(tempNumber);
  
                      numberListAdapter.notifyDataSetChanged();
                  }
              });
  
              alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int whichButton) {
                      // Canceled.
                  }
              });
  
              alert.show();
          }
  
  
              }
          }
      }
      catch (Exception e)
      {
          Log.d(TAG, "Names, Numbers and Emails failed to set ");
          e.printStackTrace();
      }
  }
  
  
  
  private static class NumberListAdapter extends ArrayAdapter&lt;Number&gt;
  {
  
      /**
       * Used to create the initial views that populate the list.
       */
      private LayoutInflater mInflater = null;
  
      /**
       * List of stations after the filter has been applied.
       */
      public List&lt;Number&gt; filteredItems;
  
      /**
       * List of all stations.
       */
      public ArrayList&lt;Number&gt; originalItems = new ArrayList&lt;Number&gt;();
  
      /**
       * Used to search the stations and update the list appropriately.
       */
      private Filter filter;
  
      public NumberListAdapter(Context context, int textViewResourceId,
              List&lt;Number&gt; contactNumbersList) {
          super(context, textViewResourceId, contactNumbersList);
  
          // Cache the LayoutInflate to avoid asking for a new one each time.
          mInflater = LayoutInflater.from(context);
          // keep track of the list of provided Station objects and a copy for
          // applying filters
          this.filteredItems = contactNumbersList;
          cloneItems(contactNumbersList);
  
      }
  
      protected void cloneItems(List&lt;Number&gt; contactNumbersList) {
          for (Iterator&lt;Number&gt; iterator = contactNumbersList.iterator(); iterator
          .hasNext();) {
              Number s = (Number) iterator.next();
              originalItems.add(s);
          }
      }
  
      static class ViewHolder
      {
          TextView number;
          //TODO: Will need to possibly assign function of this
          Button deleteBTN;
      }
  
      /**
       * Populates each row of the custom list with data
       */
      /*
       * (non-Javadoc)
       * @see android.widget.ArrayAdapter#getView(int, android.view.View,
       * android.view.ViewGroup)
       */
      @Override
      public View getView(int position, View convertView, ViewGroup parent)
      {
          // this will hold onto the widgets associated with a particular list
          // entry
          ViewHolder holder;
  
          if (convertView == null)
          {
              // if there's no views to recycle, inflate a new one
              convertView = mInflater.inflate(R.layout.row, null);
  
              // store the widgets in the holder
              holder = new ViewHolder();
              //                holder.number = (TextView) convertView.findViewById(R.id.rowTextView);
              //                holder. = (Button) convertView.findViewById(R.id.rowButton);
              holder.number = (TextView) convertView.findViewById(R.id.rowTextView);
              holder.deleteBTN = (Button) convertView.findViewById(R.id.rowButton);
              // tag the holder to the view so that they can be retrieved next
              // time
              convertView.setTag(holder);
          }
          else
          {
              // retrieved the tagged ViewHolder
              holder = (ViewHolder) convertView.getTag();
          }
  
          // retrieve the current Station object
          Number temp = filteredItems.get(position);
  
          if (temp != null)
          {
              try
              {   
                  holder.number.setText(temp.getnumber());
  
              }
              catch (Exception e)
              {
                  Log.d(TAG, "getView - failed");
                  e.printStackTrace();
              }
          }
          return convertView;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any help would be appreciated thanks.</p>