@Override
 public void setUserVisibleHint(final boolean isVisibleToUser) {
   super.setUserVisibleHint(isVisibleToUser);
   if (!isVisibleToUser && mActionMode != null) {
     mActionMode.finish();
   }
 }
 @Override
 public void onActivityCreated(final Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   setHasOptionsMenu(true);
   mResolver = getContentResolver();
   final ListView listView = getListView();
   listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
   listView.setMultiChoiceModeListener(this);
   getLoaderManager().initLoader(0, null, this);
   setRefreshEnabled(false);
   showProgress();
 }