在Android的activity中调用onResume
在活动的过程中通过调用 this.OnResume() 强制 onResume 事件可以吗?或者我应该实现另一个由 OnResume 和第一个成员调用的过程?
is it ok in an activity's procedure to force the onResume event by calling this.OnResume() ? Or should I implement another procedure that's called by both OnResume and by the first member ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实现在重写
onResume()
时调用的另一个过程。后者不打算由您调用,它是一种方便的方法,可以在 Activity 的状态更改为resume
时整理或准备 Activity。很像onCreate()
到onDestroy()
。Implement another procedure that's called in your override of
onResume()
. The latter is not intended to be called by you, it's a convenience method that tidies up or readies the activity when its state changes toresume
. A lot likeonCreate()
through toonDestroy()
.@SK9 所说的,而且特别是因为当您重写 onResume 方法时,您必须调用 super.onResume(),因此您无法控制后台发生的情况(视图刷新等) 。
What @SK9 said, but also especially because you must call super.onResume() when you override the onResume method, so you're not in control what happens in the background (views getting refreshed, etc).