title: Setting the getItem on a custom adapter
body: <p>Because I am using a custom listView adapter for my applicaiton, some of the default methods are overridden. The problem occurs when I call the <code>getItem(position)</code> method of the adapter. Because this method is overridden, my attempt to find out the selected items are returned as null.</p>
  
  <p>The custom adapter overrides the method as follows:</p>
  
  <pre><code>        @Override
          public Object getItem(int position) {
              // TODO Auto-generated method stub
              return null;
          }
  </code></pre>
  
  <p>The call for getting the selected items:</p>
  
  <pre><code>public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
      // retrieve selected items and print them out
      ArrayListAdapter adapter = (ArrayListAdapter) Allprojects.this.getListAdapter();
      SparseBooleanArray selected = adapter.getSelectedIds();
      StringBuilder message = new StringBuilder();            
      for (int i = 0; i &lt; selected.size(); i++){               
          if (selected.valueAt(i)) {
              String selectedItem = (String) adapter.getItem(selected.keyAt(i));
              message.append(selectedItem + "\n");
          }
      }           
      Toast.makeText(Allprojects.this, message.toString(), Toast.LENGTH_LONG).show();
  
      // close action mode
      mode.finish();
      return false;
  }
  </code></pre>
  
  <p>How do I now override the getItem(position) method such that I get the selected items. Please do help.</p>