How handle click listener for recyclerView item from contextual action mode?Contextual Action Mode custom behaviorHow to add dividers and spaces between items in RecyclerView?Using Espresso to click view inside RecyclerView itemProblems with implementing contextual action mode in recyclerview fragmentRecyclerView with contextual action menu flickeringHow not to finish “batch contextual actions” when all items deselected in Android Listview?Android Contextual Action Bar - Get RecyclerView Positionremove back/home button from action mode on long press in androidHow to show always 5 items in Action mode menu like WhatsApp in Android toolbarContextual Action Mode for listview

Dealing with stress in coding interviews

To what extent should we fear giving offense?

1mth baby boy keeps peeing through diapers, sometimes diper seems practically unused

What happened to the HDEV ISS Experiment? Is it over?

Half filled water bottle

Contours of a national emergency in the United States

Set orthographic view using python?

Can Orcus use Multiattack with any melee weapon?

Hangman game in Python - need feedback on the quality of code

Why is the UK so keen to remove the "backstop" when their leadership seems to think that no border will be needed in Northern Ireland?

How do you capitalize agile costs with less mature teams?

Weird corners with cline

Did anybody find out it was Anakin who blew up the command center?

Discussing work with supervisor in an invited dinner with his family

How long do you think advanced cybernetic implants would plausibly last?

How many birds in the bush?

"There were either twelve sexes or none."

Billiard balls collision

Is the negative potential of 書く used in this sentence and what is its meaning?

How many petaflops does it take to land on the moon? What does Artemis need with an Aitken?

Can I get a PhD for developing an educational software?

Why does a sticker slowly peel off, but if it is pulled quickly it tears?

Is it unusual for a math department not to have a mail/web server?

Disk usage of integer column vs boolean column in Postgres



How handle click listener for recyclerView item from contextual action mode?


Contextual Action Mode custom behaviorHow to add dividers and spaces between items in RecyclerView?Using Espresso to click view inside RecyclerView itemProblems with implementing contextual action mode in recyclerview fragmentRecyclerView with contextual action menu flickeringHow not to finish “batch contextual actions” when all items deselected in Android Listview?Android Contextual Action Bar - Get RecyclerView Positionremove back/home button from action mode on long press in androidHow to show always 5 items in Action mode menu like WhatsApp in Android toolbarContextual Action Mode for listview






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















enter image description here



I want to make recyclerview item click like this image.When i selected recyclerview item press long click then contextual action mode is enable.If i select only one item then show edit menu item else not.I want when i click edit menu item then click on recyclerView selected item and do some work.But i can't do it.Please help me some one.I am a new in android development.
Advanced Thank you.










share|improve this question






























    1















    enter image description here



    I want to make recyclerview item click like this image.When i selected recyclerview item press long click then contextual action mode is enable.If i select only one item then show edit menu item else not.I want when i click edit menu item then click on recyclerView selected item and do some work.But i can't do it.Please help me some one.I am a new in android development.
    Advanced Thank you.










    share|improve this question


























      1












      1








      1








      enter image description here



      I want to make recyclerview item click like this image.When i selected recyclerview item press long click then contextual action mode is enable.If i select only one item then show edit menu item else not.I want when i click edit menu item then click on recyclerView selected item and do some work.But i can't do it.Please help me some one.I am a new in android development.
      Advanced Thank you.










      share|improve this question














      enter image description here



      I want to make recyclerview item click like this image.When i selected recyclerview item press long click then contextual action mode is enable.If i select only one item then show edit menu item else not.I want when i click edit menu item then click on recyclerView selected item and do some work.But i can't do it.Please help me some one.I am a new in android development.
      Advanced Thank you.







      android android-recyclerview onitemclicklistener contextual-action-bar android-actionmode






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 19:58









      Rabbi hasanRabbi hasan

      432 silver badges7 bronze badges




      432 silver badges7 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0















          I grab some info for you, that might be help for you,



          Once setSelectable() is implemented, you can achieve the rest of CHOICE_MODE_MULTIPLE_MODAL by using a regular ActionMode.Callback. Call through to your setSelectable() from within the relevant callback methods:



          private ActionMode.Callback mDeleteMode = new ActionMode.Callback() 
          @Override
          public boolean onPrepareActionMode(ActionMode actionMode, Menu menu)
          setSelectable(true);
          return false;


          @Override
          public void onDestroyActionMode(ActionMode actionMode)
          setSelectable(false);


          @Override
          public boolean onCreateActionMode(ActionMode actionMode, Menu menu) ...

          @Override
          public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) ...



          Then use a long click listener to turn on the action mode:



          private class CrimeHolder extends SwappingHolder
          implements View.OnClickListener, View.OnLongClickListener

          ...

          public CrimeHolder(View itemView)
          ...

          itemView.setOnClickListener(this);
          itemView.setOnLongClickListener(this);
          itemView.setLongClickable(true);


          @Override
          public boolean onLongClick(View v)
          ActionBarActivity activity = (ActionBarActivity)getActivity();
          activity.startSupportActionMode(mDeleteMode );
          setSelected(this, true);
          return true;




          Let me know if you have any idea from this snippet. if you want more go this link, which is great article by Bill Phillips.






          share|improve this answer


























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385514%2fhow-handle-click-listener-for-recyclerview-item-from-contextual-action-mode%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0















            I grab some info for you, that might be help for you,



            Once setSelectable() is implemented, you can achieve the rest of CHOICE_MODE_MULTIPLE_MODAL by using a regular ActionMode.Callback. Call through to your setSelectable() from within the relevant callback methods:



            private ActionMode.Callback mDeleteMode = new ActionMode.Callback() 
            @Override
            public boolean onPrepareActionMode(ActionMode actionMode, Menu menu)
            setSelectable(true);
            return false;


            @Override
            public void onDestroyActionMode(ActionMode actionMode)
            setSelectable(false);


            @Override
            public boolean onCreateActionMode(ActionMode actionMode, Menu menu) ...

            @Override
            public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) ...



            Then use a long click listener to turn on the action mode:



            private class CrimeHolder extends SwappingHolder
            implements View.OnClickListener, View.OnLongClickListener

            ...

            public CrimeHolder(View itemView)
            ...

            itemView.setOnClickListener(this);
            itemView.setOnLongClickListener(this);
            itemView.setLongClickable(true);


            @Override
            public boolean onLongClick(View v)
            ActionBarActivity activity = (ActionBarActivity)getActivity();
            activity.startSupportActionMode(mDeleteMode );
            setSelected(this, true);
            return true;




            Let me know if you have any idea from this snippet. if you want more go this link, which is great article by Bill Phillips.






            share|improve this answer































              0















              I grab some info for you, that might be help for you,



              Once setSelectable() is implemented, you can achieve the rest of CHOICE_MODE_MULTIPLE_MODAL by using a regular ActionMode.Callback. Call through to your setSelectable() from within the relevant callback methods:



              private ActionMode.Callback mDeleteMode = new ActionMode.Callback() 
              @Override
              public boolean onPrepareActionMode(ActionMode actionMode, Menu menu)
              setSelectable(true);
              return false;


              @Override
              public void onDestroyActionMode(ActionMode actionMode)
              setSelectable(false);


              @Override
              public boolean onCreateActionMode(ActionMode actionMode, Menu menu) ...

              @Override
              public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) ...



              Then use a long click listener to turn on the action mode:



              private class CrimeHolder extends SwappingHolder
              implements View.OnClickListener, View.OnLongClickListener

              ...

              public CrimeHolder(View itemView)
              ...

              itemView.setOnClickListener(this);
              itemView.setOnLongClickListener(this);
              itemView.setLongClickable(true);


              @Override
              public boolean onLongClick(View v)
              ActionBarActivity activity = (ActionBarActivity)getActivity();
              activity.startSupportActionMode(mDeleteMode );
              setSelected(this, true);
              return true;




              Let me know if you have any idea from this snippet. if you want more go this link, which is great article by Bill Phillips.






              share|improve this answer





























                0














                0










                0









                I grab some info for you, that might be help for you,



                Once setSelectable() is implemented, you can achieve the rest of CHOICE_MODE_MULTIPLE_MODAL by using a regular ActionMode.Callback. Call through to your setSelectable() from within the relevant callback methods:



                private ActionMode.Callback mDeleteMode = new ActionMode.Callback() 
                @Override
                public boolean onPrepareActionMode(ActionMode actionMode, Menu menu)
                setSelectable(true);
                return false;


                @Override
                public void onDestroyActionMode(ActionMode actionMode)
                setSelectable(false);


                @Override
                public boolean onCreateActionMode(ActionMode actionMode, Menu menu) ...

                @Override
                public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) ...



                Then use a long click listener to turn on the action mode:



                private class CrimeHolder extends SwappingHolder
                implements View.OnClickListener, View.OnLongClickListener

                ...

                public CrimeHolder(View itemView)
                ...

                itemView.setOnClickListener(this);
                itemView.setOnLongClickListener(this);
                itemView.setLongClickable(true);


                @Override
                public boolean onLongClick(View v)
                ActionBarActivity activity = (ActionBarActivity)getActivity();
                activity.startSupportActionMode(mDeleteMode );
                setSelected(this, true);
                return true;




                Let me know if you have any idea from this snippet. if you want more go this link, which is great article by Bill Phillips.






                share|improve this answer















                I grab some info for you, that might be help for you,



                Once setSelectable() is implemented, you can achieve the rest of CHOICE_MODE_MULTIPLE_MODAL by using a regular ActionMode.Callback. Call through to your setSelectable() from within the relevant callback methods:



                private ActionMode.Callback mDeleteMode = new ActionMode.Callback() 
                @Override
                public boolean onPrepareActionMode(ActionMode actionMode, Menu menu)
                setSelectable(true);
                return false;


                @Override
                public void onDestroyActionMode(ActionMode actionMode)
                setSelectable(false);


                @Override
                public boolean onCreateActionMode(ActionMode actionMode, Menu menu) ...

                @Override
                public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) ...



                Then use a long click listener to turn on the action mode:



                private class CrimeHolder extends SwappingHolder
                implements View.OnClickListener, View.OnLongClickListener

                ...

                public CrimeHolder(View itemView)
                ...

                itemView.setOnClickListener(this);
                itemView.setOnLongClickListener(this);
                itemView.setLongClickable(true);


                @Override
                public boolean onLongClick(View v)
                ActionBarActivity activity = (ActionBarActivity)getActivity();
                activity.startSupportActionMode(mDeleteMode );
                setSelected(this, true);
                return true;




                Let me know if you have any idea from this snippet. if you want more go this link, which is great article by Bill Phillips.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 27 at 21:23

























                answered Mar 27 at 21:13









                Dharma KshetriDharma Kshetri

                6,64711 gold badges40 silver badges77 bronze badges




                6,64711 gold badges40 silver badges77 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385514%2fhow-handle-click-listener-for-recyclerview-item-from-contextual-action-mode%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript