Toast message from Broadcast Receiver

后端 未结 3 1926
灰色年华
灰色年华 2021-01-01 14:54

I have a broadcast receiver and I am trying to show a toast message from it, is this possible ? This code doesn\'t show the toast but it print the log message in the logcat.

3条回答
  •  一整个雨季
    2021-01-01 15:10

    you forgot to call show() on the Toast.. although i would not recommend creating toasts from BroadcastReceivers.. you might consider using Notifications

提交回复
热议问题