When should super.onResume() be called?

后端 未结 3 892
孤城傲影
孤城傲影 2020-12-29 22:43

When should super.onResume(); be called, on the first line of onResume() or on the last line?

protected void onResume() {
    Log.i         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-29 22:58

    Whether or not you choose to call the super method depends upon whether you require the inherited functionality. You can often find out if you need to call the super method from Api documentation.

    Sometimes you need to do something before the super method is called (ie filter an attribute or perform an action). Sometimes your code has to happen after the super method has executed.

    It is very much implementation specific.

提交回复
热议问题