What is the difference between a Listener and a Receiver (Android)?

前端 未结 4 1044
余生分开走
余生分开走 2020-12-25 13:12

For instance, I need a BroadcastReceiver to get these events:

REBOOT or SHUTDOWN

SCREEN ON or OFF

battery status (voltage, plugged in, temperature)

4条回答
  •  失恋的感觉
    2020-12-25 13:17

    The major difference can be that:

    Event Listeneres are of more continuous form i.e. the events such as related to sensors or button clicks are more often.

    But receiver is of a discontinuous nature, i.e. the events here are not so of a continuous nature for example, Boot on/off, message etc

提交回复
热议问题