View Binding – How do I get a binding for included layouts?

In case of: Include with generic layout (not merge node), we need to assign ID to included part, this way in binding we will have access to included sub part <include android:id=”@+id/your_id” layout=”@layout/some_layout” /> This way in your activity code: private lateinit var exampleBinding: ActivityExampleBinding //activity_example.xml layout override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) exampleBinding = … Read more