title: Android ListView Single Choice Mode with Action Mode
body: <p>I would like to create an app screen that include one ListView.
  When the user performs long press on ListView item, I would like to show action mode. I implemented it with the following code and I got the result which I want.</p>
  
  <p>One problem is that I would like to allow the user to select only one list item and select the context menu item in action mode to do the operation. The following code is allowed the user to select multiple list items. </p>
  
  <p>Is android not support ListView.CHOICE_MODE_SINGLE_MODAL choice mode? I had spend a lot of time in Googling but can't find any reference to implement which allows a single choice mode with context action mode. Please help. </p>
  
  <pre><code>        mTestListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
          mTestListView.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() {
              @Override
              public void onItemCheckedStateChanged(ActionMode actionMode, int position, long l, boolean value) {
              }
  
              @Override
              public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
                  MenuInflater inflater = actionMode.getMenuInflater();
                  inflater.inflate(R.menu.context_menu_test_single_choice_mode, menu);
                  return true;
              }
  
              @Override
              public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
                  return false;                    
              }
  
              @Override
              public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
                  switch (menuItem.getItemId()) {
                      case R.id.action_done:
                          Toast.makeText(getActivity(), "Done", Toast.LENGTH_SHORT).show();
  
                          actionMode.finish();
                          adapter.notifyDataSetChanged();
                          return true;
                      default:
                          return false;
                  }
              }
  
              @Override
              public void onDestroyActionMode(ActionMode actionMode) {
              }
          });
      }
  </code></pre>