How do you display a Toast from a background thread on Android?

后端 未结 11 1872
难免孤独
难免孤独 2020-11-22 05:03

How can I display Toast messages from a thread?

11条回答
  •  孤街浪徒
    2020-11-22 05:52

    1. Get UI Thread Handler instance and use handler.sendMessage();
    2. Call post() method handler.post();
    3. runOnUiThread()
    4. view.post()

提交回复
热议问题