一.子类Activity转Kotlin(有父类BaseActivity)
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter savedInstanceState
修改:
override funonCreate(savedInstanceState: Bundle) {
super.onCreate(savedInstanceState)
}
为:
override funonCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
分析:savedInstanceState为非空类型,调用super.onCreate(savedInstanceState) savedInstanceState为空,运行时报错。
网友评论