Android - Activity constructor

前端 未结 4 859
执念已碎
执念已碎 2020-12-20 09:06

I noticed that using the shortcut Alt + Insert and selecting the builders, it tries to create a constructor with each private property (e.g. cManager

4条回答
  •  北海茫月
    2020-12-20 09:19

    Android activity allows only class default constructor is allowed. i.e. constructor with zero parameters. In default constructor you can do initializations to those final variables except which are linked system services as only available after lifecycle onCreate method.

提交回复
热议问题