开发者

ViewFlipper, onClick events not delivered

I have my own implementation of the ViewFlipper (that exactly mocks the Android code, I wrote it before I realized this), the only difference being the fact that I hardcoded an inAnimation and an outAnimation in mine.

One side of the ViewFlipper has a 'flip' b开发者_如何学Cutton which flips. The other side has a 'save' and 'cancel' button which flips it back. The 'save' performs a DB operation.

When the save or cancel, it flips the card correctly. If I perform the following operation: flip->cancel->flip->cancel..., it works fine. But when I perform: flip->save->flip, the last flip is non-response and logcat shows me that the touch operation was not delivered because of a timeout. The first thing I checked and ensured was that the database operation was not holding off the UI thread, and it was not!

I use the content of the ViewFlipper (using the View.getContent()) to perform DB operations, throw Toasts, build Alert Dialogs and the like. Might this create issues?

I've read a post somewhere saying that there was an issue with the ViewFlipper with animations and onClick() events not being delivered (the discussion ended with no solution). Am I a victim of this?


Try doing the save operation in a thread even though you are sure its not blocking the UI thread.
If that does not work, then set onTouch listener to the save view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜