title: Add New Item in Listview dynamically
body: <p>I am a beginner and I want to add items in my Predefined array </p>
  
  <pre><code>public class MainActivity extends ListActivity {
          //LIST OF ARRAY STRINGS WHICH WILL SERVE AS LIST ITEMS
          ;
          String listItem[]={"Dell Inspiron", "HTC One X", "HTC Wildfire S", "HTC Sense", "HTC Sensation XE"};
  
  
          ArrayAdapter&lt;String&gt; adapter;
          EditText et;
  
          @Override
          public void onCreate(Bundle icicle) {
  
          super.onCreate(icicle);
          setContentView(R.layout.main);
          adapter=new ArrayAdapter&lt;String&gt;(this,
              android.R.layout.simple_list_item_1,
              listItem);
          setListAdapter(adapter);
          et=(EditText) findViewById(R.id.editText);
      }
  
  
      public void addItems(View v) {
          String data=et.getText().toString();
          listItem.add(""+data);
          adapter.notifyDataSetChanged();
      }
  }
  </code></pre>