0

是否可以区分应用程序停用的原因?

当用户按下返回按钮或有通话\短信时,应用程序进入停用状态。我的问题是 - 如何区分原因?防止作弊等很重要。

我有计时器 - 有收入电话或短信时可以冻结它。如果按下后退按钮,则不应保存。

4

2 回答 2

1

Haven't tested it but it may work:

  • Handle the back button on your page, set a static flag to true, then proceed with the 'normal' back button behaviour
  • On each page, override OnNavigatedTo and set the flag to false

Now, when the Desactivated event is triggered, if the flag is set to true then you know the user has pressed the back button.

于 2012-01-29T11:57:39.470 回答
1

如果这是为了防止在游戏中作弊,我不会区分“返回”和“接听电话”,因为这会让用户感到困惑,并且会通过让别人给他们打电话来触发其他人作弊。

只需从游戏的最后一个保存点恢复或提议再次尝试该关卡。

于 2012-01-29T16:58:51.440 回答