Q:

create static android broadcast reciever programatically

Hi is there a way to programatically create a static broadcast reciever programatically? 
From the docs it says there are two ways to use recievers:

Register through manifest(static and can be used when app is not running)
Register through application Context(Dynamic and can only be used as long as the activity/app is running)

I could not find a way to register programatically a static receiver.  Is there not a way to do this? 

A:

You cannot modify the manifest at runtime.  Hence, you cannot register a "static" receiver at runtime. 
You can enable and disable a manifest-registered receiver at runtime.  Have the android:enabled attribute on your <receiver> element be set to whatever you want your starting state to be (e.g., false for disabled).  Then, use PackageManager and setComponentEnabledSetting() to change that enabled status at runtime.  A disabled receiver will not respond to broadcasts.