1

I am creating search page and I have use activity and places in GWT. I have used Key Listener so when user press Enter it redirect user on result page. Problem is that when user use browser back button and again press enter Key Listener call twice same if user again click back button next time it will call trice and so on. Is there any solution for this?

4

1 回答 1

1

您可能会在活动开始时添加您的侦听器,但从不删除它(例如,当活动停止时)。

完整的解决方案取决于您如何编码您的活动(您是否重用活动实例?您是否有一个单独的视图,活动充当演示者/控制器?如果是这样,视图是单例,还是列表比活动寿命更长,并且可以被另一个活动实例重用?等)

于 2013-05-04T09:13:13.900 回答