Вопрос

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