title: Select Item in Listview Actionbar
body: <p>how can i select an item in a ListView after i start an Custom Actionbar.</p>
  
  <pre><code>public class UserListActivityAdapter extends BaseAdapter {
  
  String[] mNameList;
  int[] imageID;
  Context mContext;
  LayoutInflater inflater;
  boolean isLongPressed = false;
  
  public UserListActivityAdapter(UserListAcitivty context,
          String[] nameList,
          int[] imageList) {
  
      this.mContext = context;
      this.imageID = imageList;
      this.mNameList = nameList;
      inflater = LayoutInflater.from(context);
  
  }
  
  @Override
  public int getCount() {
      return mNameList.length;
  }
  
  @Override
  public Object getItem(int position) {
      return position;
  }
  
  @Override
  public long getItemId(int position) {
      return position;
  }
  
  public static class Holder {
      TextView tv;
      TextView desc;
      ImageView img;
  }
  
  @Override
  public View getView(int position,
          View convertView,
          ViewGroup parent) {
  
      Holder holder = new Holder();
      View rowView;
  
      rowView = inflater.inflate(R.layout.row_layout_user, parent,    false);
      holder.tv = (TextView) rowView.findViewById(R.id.desc);
      holder.desc = (TextView) rowView.findViewById(R.id.name);
      holder.img = (ImageView) rowView.findViewById(R.id.icon);
      holder.desc.setText(mNameList[position]);
      holder.tv.setText("Blub");
      holder.img.setImageResource(imageID[position]);
      return rowView;
  }
  </code></pre>
  
  <p>When i click on an item it change the background but when i start the actionbar it dont change anymore.</p>
  
  <pre><code>public class UserListAcitivty extends Activity implements
      MultiChoiceModeListener  {
  private ListView mListView;
  String[] list;
  private int count;
  UserListActivityAdapter user;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      list = new String[] { "Hans Schmidt", "Felix DieKatze", "Wolfgang  Müller" };
      int[] img = new int[] { R.drawable.ic_launcher,   R.drawable.abs__ab_bottom_solid_dark_holo, R.drawable.icon };
      setContentView(R.layout.userlistactivity_layout);
  
      mListView = (ListView) findViewById(R.id.userList);
      mListView.setEmptyView(findViewById(R.id.empty_userlist));
      user = new UserListActivityAdapter(this, list, img);
      mListView.setAdapter(user);
      mListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
      mListView.setMultiChoiceModeListener(this);
  }
  
  
          @Override
          public boolean onPrepareActionMode(ActionMode mode,
                  Menu menu) {
  
              return false;
          }
  
          @Override
          public void onDestroyActionMode(ActionMode mode) {
  
          }
  
          @Override
          public boolean onCreateActionMode(ActionMode mode,
                  Menu menu) {
              MenuInflater inflater = mode.getMenuInflater();
              inflater.inflate(R.menu.my_context_menu, menu);
              return true;
          }
  
          @Override
          public boolean onActionItemClicked(ActionMode mode,
                  MenuItem item) {
              return false;
          }
  
          @Override
          public void onItemCheckedStateChanged(ActionMode mode,
                  int position,
                  long id,
                  boolean checked) {
              count = count + 1;
              mode.setTitle(count + " User selected");
      mListView.setItemChecked(position, checked);
  
          }
  }
  </code></pre>
  
  <p>This is the selector for the view</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android" &gt;
       &lt;!-- Normal state. --&gt;
  &lt;item android:drawable="@color/list_row_default_bg" 
      android:state_pressed="false" 
      android:state_selected="false"/&gt;
  &lt;!-- pressed state. --&gt;
  &lt;item android:drawable="@color/list_row_pressed_bg" 
      android:state_pressed="true"/&gt;
  &lt;!-- Selected state. --&gt;
  &lt;item android:drawable="@color/list_row_selected_bg" 
      android:state_selected="true"/&gt;    
  </code></pre>
  
  <p></p>