I followed http://www.designerandroid.com/?p=8 this one to add the values in the spinner.In it while we select the "clear spinner items" the whole events are will be delete. But i need to the selected particular item only want to delete.Any one can help me.. The sample code will help to me lot.
To delete particular item from spinner you have to remove it from arrayadapter which is you using for filling it.
so first get the position of item you r wanting to delete.
than get the object frm arrayadapter from its position by mehod.
int pos = 0;object t=m_adapterForSpinner.getitem(pos);//whr m_arrayadapter is array adapter using for filling spinner
and than remove it from spinner by using following code:
than fill ur spinner again with arrayadapter.
If you want to remove the selected item in the spinner:
where "adapter" is the adapter set to the spinner, it's as simple as that. :)
if adapter is out of scope you can get the adapter from the spinner, cast properly and remove the item: