title: ListActivity view.setSelected(true) not registered if called by an onItemLongClickListener
body: <p>The following happens on Android 2.2:</p>
  
  <p>I have a ListActivity where a single item can be selected. I register 1)an onClickItemListener and 
  2)an onItemLongClick listener</p>
  
  <p>for the ListActivity's ListView. On itemClick I just set the list item being clicked as selected. On itemLongClick, I want to do the same thing and additional steps. My problem is, calling view.setSelected(true) from the onItemLongClickListener does not work - the item in the ListView does not get selected. This happens even when the exact same method is called from these two different listeners! See code below:</p>
  
  <pre><code>    /*
       * Set the onClickListeners for the ListView items.
       */
      this.listView.setOnItemClickListener(new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              itemClick(view, position);
          }
      });
      this.listView.setOnItemLongClickListener(new OnItemLongClickListener() {
          @Override
          public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              itemClick(view, position);
              return true;
          }
      });
  
      /*
       * Basic procedure when the user clicks
       * an item in the list.
       */
      private void itemClick(View view, int position) {
          view.setSelected(true);
          selectedPosition = position;
          selectedView = view;
      }
  </code></pre>
  
  <p>Here the onItemLongClickListeners returns true to prevent the click bubbling up to the onClickListener. Any help would be greatly appreciated!</p>
  
  <p>EDIT:</p>
  
  <p>Turns out </p>
  
  <pre><code>view.setSelected(true);
  </code></pre>
  
  <p>never was working out the way I thought it was. The standard functionality of the ListActivity was selecting the item for me in the above code all the time and calling view.setSelected() never actually selected the item in the ListView. Replacing the method as follows solves my problem:</p>
  
  <pre><code>    /*
       * Basic procedure when the user clicks
       * an item in the list.
       */
      private void itemClick(View view, int position) {
          getListView().setItemChecked(position, true);
          selectedPosition = position;
          selectedView = view;
      }
  </code></pre>
  
  <p>Thanks for Jimbo for helpful clarifying questions!</p>