I am making an android application that needs to use a ListView
. I want to add a menubutton that says \"Add to list\" and once the user presses that menubutton,
You have to create a layout containing a listView.
You have to create an xml lyout corresponding to one row of your list view.
You have to create an adapter which will populate data to insert in your listView
You have to create an onClickListener on your button to add data in your list
If you are using an ArrayAdapter or a CursorAdapter, add the new
item you created to the list or the cursor used by your adapter and
(notifyDataSetChanged()
is automatically called), so your adapter will update the
listview
Source : http://developer.android.com/resources/tutorials/views/hello-listview.html
Previous topic on it : Dynamic ListView in Android app