try this way
listViewCity.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int position, long id) { Toast.makeText(getApplicationContext(), " " +position , Toast.LENGTH_LONG).show(); list.remove(position); adapter.notifyDataSetChanged(); adapter.notifyDataSetInvalidated(); } });
remove from list and update list with adapter notification
edited
why do you use this operator when expanding ListActivity
listViewCity = ( ListView ) findViewById( R.id.list);
either you can get a ListView using getListView () with a ListActivity extension, or extend an action instead of ListActivity.
source share