0
在onPause裏面,我調用了名爲PlayTask的AsyncTask上的cancel(true)。但是,當我點擊進行另一項活動時,它仍然愉快地繼續。爲什麼我的電話取消不被尊重?AsyncTask.cancel不受尊重。爲什麼?
僅供參考,這裏是事件的順序:
CreateTrackActivity: btnPlay clicked
CreateTrackActivity: getting player for track
BasePlayerActivity : playing trac
BasePlayerActivity : Track playing
BasePlayerActivity : onPAUSE
BasePlayerActivity : play task cancelled
BaseActivity: onCreate
BasePlayerActivity: track received
BasePlayerActivity: track prepared
BasePlayerActivity: track setup finished
很酷。謝謝!!!!!!!!!! – hunterp 2011-12-30 03:06:21
我認爲這是不好的語義。取消是一個動詞,它應該意味着取消,而不是「警告doInBackground檢查取消」 – hunterp 2011-12-30 03:36:59
XD學會忍受它 – 2011-12-30 03:53:20