[問題] 觸發alertDialog裡的按鈕,修改本身的內容

看板AndroidDev作者 (肥宅大覺羅)時間9年前 (2016/09/03 16:29), 編輯推噓2(204)
留言6則, 3人參與, 最新討論串1/1
請教版上大大, 我有一個alertDialog, 在setView()時,放了一個Button跟TextView, 在alertDialog彈出來以後, 想請問要怎麼做可以 在按下該Button時, 去修改該TextView的內容呢? 先謝謝各位 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.36.204.119 ※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1472891374.A.41C.html

09/03 22:10, , 1F
既然都是custom view了,都能取得Button跟TextView的
09/03 22:10, 1F

09/03 22:11, , 2F
instance,就對Button寫一個OnClickListener去改
09/03 22:11, 2F

09/03 22:11, , 3F
TextView 不就好了?
09/03 22:11, 3F

09/11 12:28, , 4F
settextview(r.string.xxx)
09/11 12:28, 4F

12/31 22:42, , 5F
在setPositiveButton中寫setTest
12/31 22:42, 5F

12/31 22:43, , 6F
setText 累了打錯字
12/31 22:43, 6F
文章代碼(AID): #1NoedkGS (AndroidDev)