title: Delete item from a list
body: <p>I try to delete a clicked item from a listview but I have a Runtime error.
  I have my items in <code>R.array.sections</code> file.</p>
  
  <pre><code> public class ListCategorieActivity extends Activity{
  public static String RISULTATO = "RISULTATO";
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      String[] arrayList = getResources().getStringArray(R.array.sections);
      setContentView(R.layout.activity_list_categorie);
      ListView listview = (ListView) findViewById(R.id.listView1);
  
      final ArrayAdapter&lt;String&gt; adapter =
              new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,arrayList );
  
  
      listview.setAdapter(adapter);
      listview.setOnItemClickListener(new AdapterView.OnItemClickListener()
      {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; a, View v,int position, long id)
          {
              Bundle bundle = new Bundle();
              Intent mIntent = new Intent();
              String[] some_array = getResources().getStringArray(R.array.sections);
              bundle.putString(RISULTATO,some_array[position]);
              mIntent.putExtras(bundle);
              setResult(RESULT_OK, mIntent);
  
              //try to remove clicked item
              String toRemove = adapter.getItem(position);
              adapter.remove(toRemove);
              finish();
          }
      });
  }
  
  /*public void onItemClick(AdapterView&lt;?&gt; l, View v, int position, long id) {
      Bundle bundle = new Bundle();
      Intent mIntent = new Intent();
      String[] some_array = getResources().getStringArray(R.array.sections);
      bundle.putString(RISULTATO,some_array[position]);
      mIntent.putExtras(bundle);
      setResult(RESULT_OK, mIntent);
      finish();
  }*/
  </code></pre>
  
  <p>}</p>
  
  <p>where is my error?</p>
  
  <p>Logcat:</p>
  
  <pre><code>08-30 18:00:12.403  20111-20111/com.example.utente.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
  java.lang.UnsupportedOperationException
          at java.util.AbstractList.remove(AbstractList.java:638)
          at java.util.AbstractList$SimpleListIterator.remove(AbstractList.java:75)
          at java.util.AbstractCollection.remove(AbstractCollection.java:229)
          at android.widget.ArrayAdapter.remove(ArrayAdapter.java:244)
          at com.example.utente.myapplication.ListCategorieActivity$1.onItemClick(ListCategorieActivity.java:43)
          at android.widget.AdapterView.performItemClick(AdapterView.java:301)
          at android.widget.AbsListView.performItemClick(AbsListView.java:1287)
          at android.widget.AbsListView$PerformClick.run(AbsListView.java:3080)
          at android.widget.AbsListView.onTouchEvent(AbsListView.java:4176)
          at android.view.View.dispatchTouchEvent(View.java:7380)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2462)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2195)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2468)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2210)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2468)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2210)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2468)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2210)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2468)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2210)
          at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2177)
          at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1482)
          at android.app.Activity.dispatchTouchEvent(Activity.java:2470)
          at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2125)
          at android.view.View.dispatchPointerEvent(View.java:7565)
          at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3571)
          at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3503)
          at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4614)
          at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4592)
          at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4696)
          at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
          at android.os.MessageQueue.nativePollOnce(Native Method)
          at android.os.MessageQueue.next(MessageQueue.java:125)
          at android.os.Looper.loop(Looper.java:124)
          at android.app.ActivityThread.main(ActivityThread.java:4947)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>