View Binding και Data Binding είναι χαρακτηριστικά του Android για τη σύνδεση κώδικα με views σε layouts XML με ασφαλέστερο και πιο βολικό τρόπο από το παλιό findViewById. Το View Binding παρέχει type-safe αναφορές views· το Data Binding επιπλέον δεσμεύει δεδομένα απευθείας σε layouts.
Το πρόβλημα: 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.
