android - Why some broadcast receiver can only be registered through either Code or AndroidManifest -


some broadcast receivers work if registered via code rather defined in androidmanifest.

for example:

screen_on, screen_off 

these actions work receivers registered in code. no errors happen if registered in manifest, never called either.

what reasons undocumented behavior? security?

i don't think there security issue around this.

manifest defined broadcast receivers registered , can receive intents if application not in memory. opposite doesn't occur.

it performance issue because registering receiver type of events, may drain user battery.

main difference between manifest , programmatic registering of broadcastreceiver


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -