View Binding และ Data Binding เป็นฟีเจอร์ของ Android สำหรับเชื่อมโค้ดเข้ากับ view ใน XML layout อย่างปลอดภัยและสะดวกกว่า findViewById แบบเก่า View Binding ให้ reference ของ view แบบ type-safe ส่วน Data Binding ยังผูกข้อมูลเข้ากับ layout ได้โดยตรงด้วย
ปัญหา: 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.
