This is my first experience with android. I\'m trying to add items to my ListView. I use Tabs, and the only way to see that the item was added is to change tab and then come
Try this one it will work
public class Third extends ListActivity {
private ArrayAdapter adapter;
private List liste;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_third);
String[] values = new String[] { "Android", "iPhone", "WindowsMobile",
"Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X",
"Linux", "OS/2" };
liste = new ArrayList();
Collections.addAll(liste, values);
adapter = new ArrayAdapter(this,
android.R.layout.simple_list_item_1, liste);
setListAdapter(adapter);
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
liste.add("Nokia");
adapter.notifyDataSetChanged();
}
}