View Binding og Data Binding er Android-funksjoner for å knytte kode til views i XML-layout på en tryggere og mer praktisk måte enn den gamle findViewById. View Binding gir typesikre view-referanser; Data Binding binder i tillegg data direkte til layout.
Problemet: findViewById
The old way: findViewById to get view references:
val button = findViewById<Button>(R.id.myButton)
✗ verbose; NOT type-safe (cast errors); NOT null-safe (wrong id → null → crash at runtime)
→ View/Data Binding solve these.
