How to display Toast from a Service after main Activity finishes?

后端 未结 5 2273
一生所求
一生所求 2020-12-14 10:22

UPDATE: I don\'t agree that this is a duplicate - because I am seeking for a way to exit the main app and still show a Toast from the service.

In a

5条回答
  •  囚心锁ツ
    2020-12-14 10:57

    use the following code:

      runOnUiThread(new Runnable(){
         public void run() {
              // UI code goes here
         }
        });
    

提交回复
热议问题