There are two ways to use BroadcastReceiver , and you did not indicate what you are using.
One for the receiver registered with some other component - for example, Activity - through registerReceiver() . This receiver will work as long as it is registered, and therefore its data can last more than one call onReceive() . The component that registered the receiver will be responsible for storing data.
Another is to register the recipient in the manifest. Those for the quoted passage in cdonner's answer will leave after one call to onReceive() . Your recipient will need to save their data, database, flat file, or something else.
source share