Android 并在时间到时返回主要活动
我从主要活动开始一个新活动,
Intent i = new Intent(this, Game.class);
startActivity(i);
游戏活动有一个倒数到 0 的计时器。我想弹回主要活动(终止游戏活动)。
我该如何制定这个?
(我已经在我的游戏活动中正确定义了 onDestroy()
等。)
I start a new activity from my main activity with
Intent i = new Intent(this, Game.class);
startActivity(i);
The game activity has a timer which counts down to 0. I would like to pop back to the main activity (killing the game activity).
How do I enact this?
(I've already defined onDestroy()
etc. correctly in my game activity.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在计时器到时调用 finish() 的方法中
In the method that gets called when the timer is up call finish()