문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top