title: Android ListView: How to add a row with a buttonclick
body: <p>I have a listview. In it, each row had a text saying 0:00. But now, I added a button on my actionbar but then I got stuck. I don't know how to make the button create a new row, displaying 0:00</p>
  
  <p>This is my code for the data in a row.</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      RowData rowdata_data[] = new RowData[]
              {                   
               new RowData("0:00")            
              };
  
      RowdataAdapter adapter = new RowdataAdapter(this, 
              R.layout.listview_item_row, rowdata_data);
      listView1.setAdapter(adapter);
  
      listView1 = (ListView)findViewById(R.id.listView1);
  }
  </code></pre>
  
  <p>this is my RowData class:          </p>
  
  <pre><code>public class RowData {
  String title;
  
  public RowData(String title) {                     
      this.title = title;
  }
  }
  </code></pre>
  
  <p>So how should I implement a button click to add another row?
  Under addtionbutton: should be the method.</p>
  
  <pre><code>public boolean onOptionsItemSelected(MenuItem item) 
  {
  
      // Handle presses on the action bar items
      switch (item.getItemId()) 
      {
          case R.id.additionbutton:                      
  
              return true;           
          default:
              return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>