android - How to listen to long click on a navigationview item? -


i'm developing android app using design library , appcompat library. i'm facing issues when tried listen long click on menu item. app has navigationview side menu, inside navigationview had menu lot of items. can listen click of these items can't listen long click. know how implement it?

thanks.

update

you can use:

menu mymenu = navigationview.getmenu(); menuitem myitem = mymenu.finditem(r.id.my_item);  myitem.setonlongclicklistener(new view.onlongclicklistener() {     @override      public boolean onlongclick(view v) {        //       } }); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -