Toast message from Broadcast Receiver

后端 未结 3 1845
灰色年华
灰色年华 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:06

    Use this

    Toast.makeText(context, "this is not shown",Toast.LENGTH_LONG).show();

提交回复
热议问题