Using kotlin-android-extensions. I’m getting a NPE...
# android
g
Using kotlin-android-extensions. I’m getting a NPE trying to access a synthetic view reference inside an
apply
block.
Copy code
import kotlinx.android.synthetic.main.keypad_qb.view.*

…

    Timber.w("outer shortcuts $shortcuts”) 
    val v = inflater.inflate(R.layout.qb_keypad_shortcut_item, shortcuts, false).apply {
        Timber.w("inner shortcuts $shortcuts”)
    }
The synthetic
shortcuts
property is set as expected in the outer scope, but is null inside the
apply
. Am I doing something wrong?