i have an alertdialog in kotlin, with an ok button and a cancel button. how do i assign actions to these buttons - so that on clicking ok, it performs some tasks (e.g. run a function) and when cancelled, it just cancels?