英文:
Which one method implemented by Android's Activity Class is NOT A Template Method?
问题
A Template Method is a method that you may implement, but you must never call so which one method implemented by Android's Activity Class is NOT A Template Method?
模板方法是一个你可以实现的方法,但绝不能调用的方法,那么Android的Activity类中实现的哪个方法不是模板方法?
英文:
A Template Method is a method that you may implement, but you must never call so which one method implemented by Android's Activity Class is NOT A Template Method?
答案1
得分: 2
我可能没有正确理解问题,但我猜你在谈论生命周期方法:
- onCreate()
- onStart()
- onRestart()
- onResume()
- onPause()
- onStop()
- onDestroy()
由于它们都可以被实现,但不应该被应用程序的代码直接调用。Activity
的每个其他方法都不是 "模板"(例如 findViewById
或 getContext
)。
英文:
I probably did not understand the question correctly, however I guess you are talking about lifecycle's methods:
- onCreate()
- onStart()
- onRestart()
- onResume()
- onPause()
- onStop()
- onDestroy()
Since they all can be implemented but should never be directly called by application's code. Every other method of Activity
is not "template" (e.g. findViewById
or getContext
).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论