Android-Broadcast Receiver

前端 未结 2 465
暖寄归人
暖寄归人 2020-12-29 07:48

I am new to android. I what to know the difference between Intent and BroadcastReceiver. I am more confused with BroadcastReceiver tha

2条回答
  •  庸人自扰
    2020-12-29 08:38

    The API states:

    A BroadcastReceiver is a base class for code that will receive intents sent by sendBroadcast().

    An intent is an abstract description of an operation to be performed.

    So, a BroadcastReceiver is just an Activity that responds to Intents. You can send your own broadcasts or even the Android Device can send these system wide broadcasts including things like the battery is low, or the device just booted-up.

提交回复
热议问题