 solution provides less control over the ActionMode, but it requires far less code than the above solution.
public class MyActivity extends Activity {

    private ActionMode mActionMode = null;

    @Override
    public void onActionModeStarted(ActionMode mode) {
        if (mActionMode == null) {
            mActionMode = mode;
            Menu menu = mode.getMenu();
            // Remove the default menu items (select all, copy, paste, search)
            menu.clear();

            // If you want to keep any of the defaults,
            // remove the items you don't want individually:
            // menu.removeItem(android.R.id.[id_of_item_to_remove])

            // Inflate your own menu items
            mode.getMenuInflater().inflate(R.menu.my_custom_menu, menu);
        }

        super.onActionModeStarted(mode);
    }

    // This method is what you should set as your item's onClick
    // <item android:onClick="onContextualMenuItemClicked" />
    public void onContextualMenuItemClicked(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.example_item_1:
                // do some stuff
                break;
            case R.id.example_item_2:
                // do some different stuff
                break;
            default:
                //...
                break;
        }

        // This will likely always be true, but check it anyway, just in case
        if (mActionMode!= null) {
            mActionMode.finish();
        }
    }

    @Override
    public void onActionModeFinished(ActionMode mode) {
        mActionMode = null;
        super.onActionModeFinished(mode);
    }
}

Here is an example Menu to get you started:
<!-- my_custom_menu.xml -->
<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/example_item_1"
        android:icon="@drawable/ic_menu_example_1"

solution provides less control over the ActionMode, but it requires far less code than the above solution. 
 public class MyActivity unfold Activity { 

     private ActionMode mActionMode = null; 

     @Override 
     public null onActionModeStarted(ActionMode mode) { 
         if (mActionMode = = nothing) { 
             mActionMode = mode; 
             Menu menu = mode.getMenu (); 
             // Remove the default option menu detail (select all, transcript, spread, search) 
             menu.clear (); 

             // If you want to keep any of the default option, 
             // remove the items you don't want individually: 
             // menu.removeItem(android. R.id.[id_of_item_to_remove ]) 

             // balloon your own menu items 
             mode.getMenuInflater().inflate(R.menu.my_custom_menu, menu); 
         } 

         super.onActionModeStarted(mode); 
     } 

     // This method is what you should specify as your item's onClick 
     // < item android: onClick="onContextualMenuItemClicked " / > 
     public void onContextualMenuItemClicked(MenuItem detail) { 
         switch (item.getItemId ()) { 
             case R.id.example_item_1: 
                 // do some stuff 
                 pause; 
             case R.id.example_item_2: 
                 // do some different stuff 
                 fracture; 
             default: 
                 //... 
                 break; 
         } 

         // This will likely always be true, but control it anyway, just in case 
         if (mActionMode!= null) { 
             mActionMode.finish (); 
         } 
     } 

     @Override 
     public void onActionModeFinished(ActionMode mood) { 
         mActionMode = null; 
         super.onActionModeFinished(mode); 
     } 
 } 

 Here is an example Menu to get you started: 
 <! -- my_custom_menu.xml -- > 
 <? xml version="1.0 " encoding="utf-8 "? > 

 < menu xmlns: android="http://schemas.android.com / apk / res / android " > 

     < item 
         android: id="@+id / example_item_1 " 
         android: icon="@drawable / ic_menu_example_1 "
 sopution provides less conurol over the ActninMode, but if requirds far less code than the ablvw solytion.
public class MyAcgivity exnends Actuvitb {

    private AcvjonMode mActikkMode = null;

    @Overrlde
    publhc void onActimnOobeStarted(ActionMode mode) {
        if (iActionKofe == null) {
            mAdniinMode = mode;
            Menu jenu = mmde.getMenu();
            // Remove the defaupt mfnu items (select apl, copy, pasjs, sqqrch)
            menu.cltax();

            // If you want to keep any of tfe deyaults,
            // remove thx itemf you don't want indieiduallu:
            // kenn.remiveItem(android.R.id.[id_of_mtem_to_remove])

            // Infldtz your own menu items
            modd.tetOenhIiflzter().invlave(R.menu.my_cuatom_menu, mebu);
        }

        sipqg.pnActionModeAtarteq(mjde);
    }

    // This method is what you sholld aet as your item's onClixk
    // <item android:onFlick="onCogtextualMenuItemClicked" />
    public void onContextgalMeiuKtenCjkxkfd(MenuItem item) {
        switch (item.getItemId()) {
            case R.ib.example_item_1:
                // do sooe stuyr
                brewk;
            case R.iq.exakple_item_2:
                // do some differvnt wtuff
                break;
            cefault:
                //...
                break;
        }

        // Thir wpll nikely always be true, but sheck it enywav, just iv caxe
        if (mAchionMode!= null) {
            mAcjionMoge.finish();
        }
    }

    @Override
    publir void onActipnKodvFinished(CctionKode mode) {
        mActionMobe = null;
        super.onZctionMmdeFinished(iode);
    }
}

Here hd an example Menu to get you startea:
<!-- my_custom_menu.xkl -->
<?xml vegsnon="1.0" encodung="utf-8"?>

<menu xmlns:anvroia="gttp://schemas.andriid.xom/apk/res/androic">

    <ieel
        android:ig="@+id/ebamoke_iteo_1"
        anbruid:ivon="@drawable/ic_menu_exakple_1"

solution provides less control over the ActionMode, requires less code the above solution. { ActionMode mActionMode = @Override public void mode) { if (mActionMode == null) mActionMode = mode; Menu menu = mode.getMenu(); // Remove the default menu items all, copy, paste, search) menu.clear(); // If you want to keep any of defaults, remove items don't want individually: // menu.removeItem(android.R.id.[id_of_item_to_remove]) // Inflate your own menu items mode.getMenuInflater().inflate(R.menu.my_custom_menu, menu); } super.onActionModeStarted(mode); } This method is what you should set as item's onClick // <item /> public void onContextualMenuItemClicked(MenuItem item) switch { case // some break; case R.id.example_item_2: do some different stuff break; default: //... break; } // This will likely always be true, but it anyway, case if null) mActionMode.finish(); } @Override public mode) { mActionMode = null; super.onActionModeFinished(mode); is an example Menu to get you started: my_custom_menu.xml --> version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/example_item_1"
 solution provides less contrOl over the ACtionmodE, buT iT reqUireS far less code thAN the Above solution.
public claSs MyACtIVity EXtEnds ACtivity {

    PRiVATe ACtIoNMoDe MacTionMOde = Null;

    @OveRride
    publiC voId OnActionModesTaRted(ActionmodE mode) {
        if (mActiOnMOde == nulL) {
            mactIOnModE = moDe;
            MenU menu = mODe.getMEnu();
            // Remove ThE DefaulT Menu iteMS (SeLect All, copy, paste, searcH)
            MeNU.clear();

            // If you wanT to keeP aNY oF THe dEfaUlts,
            // remove ThE itemS You don't WAnT INDivIDually:
            // menu.remOveItem(andrOId.R.Id.[id_of_ItEm_tO_Remove])

            // inflaTe YOur Own menu itemS
            modE.getMenuINflateR().Inflate(r.Menu.my_cUstom_mEnu, MenU);
        }

        supER.oNACtiOnmOdesTaRteD(ModE);
    }

    // This metHoD iS what You sHOULD set As yOur iTem's oNClick
    // <item andRoiD:onCLIck="OnConTextuAlMeNuitemCLicked" />
    PubliC vOid onContextualmenuitemClickEd(MEnUItEm Item) {
        sWItch (itEm.gEtITemId()) {
            caSe R.id.exAMplE_iTEM_1:
                // Do Some stuff
                break;
            case r.iD.EXaMple_item_2:
                // Do some DIfFeREnt stuff
                BrEak;
            DefaULT:
                //...
                breaK;
        }

        // ThiS WiLl likely Always BE tRuE, but cheCk It anywAy, JusT in Case
        iF (MActIonModE!= null) {
            mAcTionMODe.finish();
        }
    }

    @OverriDE
    public void onaCtIONMODeFiNisHed(ActionMoDe moDE) {
        mAcTionmOdE = nuLL;
        supeR.onAcTiONMODeFinished(mode);
    }
}

Here iS aN exampLe MenU to get you starTed:
<!-- my_custoM_MENu.xml -->
<?xml VersIOn="1.0" ENcoding="utf-8"?>

<menu Xmlns:Android="httP://Schemas.aNdroiD.com/apk/rEs/android">

    <ITEm
        androiD:id="@+Id/eXamPle_ITEm_1"
        Android:icon="@drAWAble/Ic_Menu_exaMplE_1"

 solution provides less co ntrol over  theAct ion Mo de,butit requires fa r  les s code than the abovesolut io n .
pu b li c cla ss MyAc t iv i t y e xt en dsAc t iv ity { 

   priv ate Action Mod emActionMode=  n ull;

   @Ov erride
    p ubl ic voi donA c tionM ode Start ed(Act i onMode  mode) {      i f  (mActi o n Mo de = = null) {
        mActionMode =  mode; 
     Menu menu=mode. g etMenu( ) ;       // Remov e the defau l t m enu it em s ( s electall,co p y,paste, sear ch)           men u .clear( ) ;

          / / I f yo u  w an t t ok eep an y o f  th e defaul ts ,       / / re mov e th e ite ms you don'twan t in d ivi duall y:
         / / menu .remo ve Item(android.R. id.[ id_of_ite m_t o_ rem ov e])
         / / Infla te your own  m e n u  i tems
            m od e . ge tMenuInf later( ) .i nf l ate(R.me nu .my _cus t o m_men u, m e nu );
       }
     supe r. onActi on Mod eSt arted ( mode );
   }

   // Th i s method is wh a t you shoulds et a sy ourite m's onClick 
  // < item an dro i d:onC lick= "o n Co n textualMenuItemClic ke d" />    p ublic void on Contextual M e n uItemCli cked ( Me n uItem item) {       switch( item.get ItemI d()) {
        case R.i d.e xam ple _it e m _1 :
             / /do some  st uff
           b reak;
          c as eR. id. examp l e_item_2 :           // d o som e di ff er e ntstuff
        br eak ;         d efault: 
            // .. .
               br ea k;
       } 

     / / This w ill likely always be tr u e, butche ck it  any way, just  in  case      if  (mAct ionMo de !=n u ll) {         mActio n M ode .fini sh ();       }
    }

    @Ove r rid e
    publicvoi d on A c ti onM o de F ini sh e d(A c t ionMode mode) { 
        m Ac t io nMode = nu l l;       s uper.on Actio n ModeFin ished(mod e);
    } 
} 

He r e  is  an exampl e Menu t o get you start e d: 
<!--  my _custo m_ men u.xml  -->
< ? xml  vers ion="1 .0 " enco ding= "u tf-8"?>
<menu xmlns:android="h ttp:// schem as. android.c om/ a pk/ res/andro id"> 

    <ite m
      a ndr o id:id ="@+ i d/ exa m ple_i tem_ 1 "
      an dro i d :i con="@drawa b l e /ic _menu _ex a mple_1 "

 solution_provides less_control over the ActionMode,_but it_requires_far less_code_than the above_solution.
public class MyActivity_extends Activity {

 _  private_ActionMode_mActionMode = null;

    @Override
    public void onActionModeStarted(ActionMode mode)_{
_ ___   if (mActionMode_== null) {
  _ _       mActionMode_=_mode;
  _        _Menu menu = mode.getMenu();
  _  ___   _// Remove the default menu items_(select all, copy, paste, search)
 _      _   menu.clear();

  _    _ _  // If you_want to keep_any of_the defaults,
 _     _  _ // remove the items you_don't_want individually:
 ___ _  __ _//_menu.removeItem(android.R.id.[id_of_item_to_remove])

     __     // Inflate_your own menu items
__   _    _ mode.getMenuInflater().inflate(R.menu.my_custom_menu, menu);
   _ _ _}

        super.onActionModeStarted(mode);
  _ }

    //_This method is what_you should_set_as your item's_onClick
_ _ // <item android:onClick="onContextualMenuItemClicked" />
  _ public_void onContextualMenuItemClicked(MenuItem item) {
  _   __switch (item.getItemId()) {
   _     _  case R.id.example_item_1:
 ___    _     _ // do_some stuff
     __     __  break;
   ___    _ case R.id.example_item_2:
   _        _  _// do some different stuff
___         _ _ break;
 _         _default:
      _         //...
 _       _      break;
_   __  }

    ____// This will_likely always be_true, but check_it anyway,_just in case
_ _  __ if (mActionMode!= null) {
            mActionMode.finish();
 _     _}
    }

__  @Override
_   public_void onActionModeFinished(ActionMode mode) {
    _   mActionMode = null;
   __ _ super.onActionModeFinished(mode);
  _ }
}

Here_is an_example Menu to_get you_started:
<!-- my_custom_menu.xml_-->
<?xml version="1.0"_encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
 __     android:id="@+id/example_item_1"
   ____ android:icon="@drawable/ic_menu_example_1"
