Toast created in an IntentService never goes away

后端 未结 6 599
北海茫月
北海茫月 2020-11-28 10:53

I have an IntentService that downloads some files. The problem is that I create a Toast inside the IntentService like this

Toast.makeText(getApplicationCont         


        
6条回答
  •  一个人的身影
    2020-11-28 11:54

    IntentService will create a thread to handle the new intent, and terminated it immediately once the task has done. So, the Toast will be out of controlled by a dead thread.

    You should see some exceptions in the console when the toast showing on the screen.

提交回复
热议问题