Solved... if anyone is interested, I threw a look on the source and noticed that the message queues differ if the View is not attached to a window. So calling post() before attaching the view puts the message in a different queue ergo removeCallbacks() does nothing.
On Sep 22, 6:15 pm, loctarar <[email protected]> wrote: > Hello! > Let's say that there are two threads... a thread that waits for a > package from a server and the UI thread. When the package arrives, the > network thread calls runOnUIThread() with an anonymous implementation > of the Runnable interface which displays a PopupWindow. The popup must > be visible for X ms, so the View contained in the PopupWindow calls > postDelayed(<dismiss the popup>, X). Everything works fine, but now I > want to hide the Popup when the user touches the screen. I made the > popup focusable & touchable outside. When I capture the ACTION_DOWN > event I first callremoveCallbacks(<the same runnable object used in > the postDelayed above>) and then dimiss() the popup. The problem with > this is that theremoveCallbacksdoesn't delete the action posted in > the first place and after the popup is gone the action is still > executed. > > Any ideas about what could generate such behavior? > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

