Hello. I have an unfinished mechanism to override a method of an another class instance. Here is a part of it:
private var onActivityResultAction: ((requestCode: Int, resultCode: Int, data: Intent?) -> Unit)? = null
override fun doOnActivityResult(action: (requestCode: Int, resultCode: Int, data: Intent) -> Unit) {
onActivityResultAction = action() //Error
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
onActivityResultAction?.invoke(requestCode, resultCode, data)
super.onActivityResult(requestCode, resultCode, data)
}
How should I fix an error line ( onActivityResultAction = action()
) if I have this?
Type mismatch. Required: ((Int, Int, Intent?) β Unit)? Found: Unit