Calling onResume in Android's activity

核能气质少年 提交于 2019-12-07 04:47:12

问题


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 ?


回答1:


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 to resume. A lot like onCreate() through to onDestroy().




回答2:


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).



来源:https://stackoverflow.com/questions/6012171/calling-onresume-in-androids-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!