How to force derived class to call super method? (Like Android does)

前端 未结 8 2284
余生分开走
余生分开走 2020-12-08 04:00

I was wondering, when creating new Activity classes and then overriding the onCreate() method, in eclipse I always get auto added: super.onCr

8条回答
  •  情歌与酒
    2020-12-08 04:04

    This is added in the support annotation library:

    dependencies {
        compile 'com.android.support:support-annotations:22.2.0'
    }
    

    http://tools.android.com/tech-docs/support-annotations

    @CallSuper

提交回复
热议问题