title: ActionMode OnCreateActionMode not called
body: <p>I am working on an Android app with a contextual action bar but the onCreateActionMode is not being called, nor is the listview item being set selected, nor is the itemcheckstatechanged listener working. </p>
  
  <p>Below is how I am creating the action mode:</p>
  
  <pre><code>AdapterView.OnItemLongClickListener mOnItemLongClickListener = new AdapterView.OnItemLongClickListener()
      {
          @Override
          public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id)
          {
  
              if (mActionMode != null)
              {
                  return false;
              }
              Toast.makeText(getActivity(), "Long Click", Toast.LENGTH_LONG).show();
              lstRooms.setOnItemClickListener(null);
              mActionMode = getActivity().startActionMode(mActionModeCallback);
              view.setSelected(true);
  
              return true;
          }
      };
  </code></pre>
  
  <p>Below is how I set the OnLongItemClickListener</p>
  
  <pre><code>lstRooms.setOnItemLongClickListener(mOnItemLongClickListener);
  </code></pre>
  
  <p>Below is my ActionMode Callback. </p>
  
  <pre><code>private ActionMode.Callback mActionModeCallback = new ActionMode.Callback()
      {
          @Override
          public boolean onCreateActionMode(ActionMode mode, Menu menu)
          {
              lstRooms.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
              lstRooms.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener()
              {
                  @Override
                  public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked)
                  {
                      Toast.makeText(getActivity(), "Clicked", Toast.LENGTH_LONG).show();
                  }
  
                  @Override
                  public boolean onCreateActionMode(ActionMode mode, Menu menu)
                  {
                      MenuInflater inflater = mode.getMenuInflater();
                      inflater.inflate(R.menu.room_context_menu, menu);
                      mode.setTitle("HELLO WORLD");
                      return true;
                  }
  
                  @Override
                  public boolean onPrepareActionMode(ActionMode mode, Menu menu)
                  {
                      return false;
                  }
  
                  @Override
                  public boolean onActionItemClicked(ActionMode mode, MenuItem item)
                  {
                      return false;
                  }
  
                  @Override
                  public void onDestroyActionMode(ActionMode mode)
                  {
  
                  }
              });
              return true;
          }
  
          @Override
          public boolean onPrepareActionMode(ActionMode mode, Menu menu)
          {
              return false;
          }
  
          @Override
          public boolean onActionItemClicked(ActionMode mode, MenuItem item)
          {
              return false;
          }
  
          @Override
          public void onDestroyActionMode(ActionMode mode)
          {
              mActionModeCallback = null;
          }
  
  
      };
  </code></pre>
  
  <p>None of the method such as the onCreateActionMode is called so my title bar isn't set, although the action bar does turn black, for some reason, I know the the text should be white as if I do <code>actionMode.setTitle("Hello")</code> after I create the object it works, it's just the call back functions aren't working. </p>
  
  <p>As mentioned the other problem is that list view item doesn't show that its selected when I do <code>view.setSelected(true)</code> I've also tried <code>lstRoom.setItemChecked(position, true)</code>.</p>