Kt: การแสดงไดอะล็อก Yes/No/Cencel (AlertDialog)

กดปุ่มแล้วจะแสดง dialog ถ้าตอบ Yes จะเปลี่ยนสี background ของ activity นี้เป็นสีแดง

activity_main.xml

MainActivity.kt

บรรทัดที่ 33 : เปลี่ยนสีของ background ด้วย setBackgroundColor()

Link