Android - SherlockActionBar long press icon menu
-
23-06-2021 - |
문제
I'm trying to listen on a long click in actionbarsherlock. The default action is to show an empty toast. I don't know how to change those actions like display a dialog or something like this. I have for example on the bar (Sherlock) an icon that says sync. I would like this button to show a toast when the user makes a long press
Thanks ! :)
해결책
See an answer from library developer (Jake Wharton) here. In a nutshell,
It is not possible. The long press is reserved for toasting an action item's title.
다른 팁
You can start an action upon user's click and in that you can run a clock and identify time and if time if more (let's say 10 say) you can show a tost.. if less do nothing.
you can trap long press using timeinterval in that case.
I hope this helps. Thanks
Better you can check this article that explain what it takes to deliver the above.