Q:

Unregister BroadcastReceiver on Android

I think I'm not seeing the bigger picture here, or have miss understood how BroadcastReceiver works. 
Let's imagine a dummy app that every time that the user receives a call, the app register the caller number at a file at the SD card.  To do that, I'd simply create a BroadcastReceiver that starts a Service every time the user receives a call. 
Now, If I want that app to works, I understand I can't call unregisterReceiver() at the onPause() method.  But in the other hand, If I run the app sometimes I get an exception: 

Activity has leaked IntentReceiver that was originally registered here.  Are you missing a call to unregisterReceiver()? 

So, what I'm missing here?  How can my dummy app receive callback at every call if I have to call unregisterReceiver()? 
Thank you,

A:

How can my dummy app receive callback at every call if I have to call unregisterReceiver()? 

There are two ways to set up a BroadcastReceiver:

registerReceiver(), which is only useful for a process that will be running for other reasons
<receiver> in the manifest

Your situation sounds like a case for using <receiver>.