Specify the ID in the <include>
<include layout="@layout/test" android:id="@+id/test1" /> Then use two findViewById to access fields in the layout
in Java:
View test1View = findViewById(R.id.test1); TextView test1TextView = (TextView) test1View.findViewById(R.id.text); or in Kotlin:
val test1TextView = test1.text Using that approach, you can access any field in any include you have.