討論串[問題] 跨class存取Handler
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓2(2推 0噓 0→)留言2則,0人參與, 最新作者freesamael (燒賣)時間11年前 (2014/08/01 17:17), 編輯資訊
0
0
1
內容預覽:
Handler 用 static 是應該的。把 Handler 宣告成 non-static inner class 反而會有lint 警告 "This Handler class should be static or leaks might occur"。. 但是為了避免 activity le
(還有362個字)

推噓1(1推 0噓 2→)留言3則,0人參與, 最新作者erttyy8821 (俠)時間11年前 (2014/08/01 16:30), 11年前編輯資訊
0
0
1
內容預覽:
我有 a.class 和 b.class. a.class extends Activity. b.class extends Thread. a底下有new一隻Handler. 今天在b.class做完事情後想呼叫a.class的Handler去更新UI. 目前使用public static的方式
(還有279個字)
首頁
上一頁
1
下一頁
尾頁