title: Change values of ArrayAdapter
body: <p>I'd like to update values of my ArrayAdapter if the first element is selected :</p>
  
  <pre><code>public ArrayAdapter&lt;String&gt; adapter;
  String[] categoriesArray;    
  ...
  
  adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, categoriesArray);
  list.setAdapter(adapter);
  
  list.setOnItemClickListener(new OnItemClickListener(){
      @Override
      public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {
          if(arg2== Consts.GAME_CATEGORY_POSITION){
  
              adapter.clear();
  
              //Add new values to array
              categoriesArray = new String[subCategories.size()];
              for (int i=0; i&lt;subCategories.size(); i++) {
                  categoriesArray[i] = subCategories.get(i).getSub_name();                    
              }           
              adapter.notifyDataSetChanged();             
          }           
      }           
  });
  </code></pre>
  
  <p>But the clear method (adapter) triggered an exception</p>
  
  <pre><code>12-27 09:37:57.376: E/AndroidRuntime(1423): java.lang.UnsupportedOperationException
  12-27 09:37:57.376: E/AndroidRuntime(1423):     at java.util.AbstractList.remove(AbstractList.java:638)
  12-27 09:37:57.376: E/AndroidRuntime(1423):     at java.util.AbstractList$SimpleListIterator.remove(AbstractList.java:75)
  12-27 09:37:57.376: E/AndroidRuntime(1423):     at java.util.AbstractList.removeRange(AbstractList.java:658)
  12-27 09:37:57.376: E/AndroidRuntime(1423):     at java.util.AbstractList.clear(AbstractList.java:466)
  12-27 09:37:57.376: E/AndroidRuntime(1423):     at android.widget.ArrayAdapter.clear(ArrayAdapter.java:258)
  </code></pre>
  
  <p>Any idea ?</p>
  
  <p>Thank you for reading.</p>