Adding intent to activity dynamically
I've got an activity for which I've defined an intent filter statically in AndroidManifest.xml. I'd like to register additional intents dynamically to that same intent filter in the activity's onStart() method. Is this possible? I'm trying to avoid hav开发者_开发问答ing to implement a separate intent receiver class.
Is this possible?
No, sorry.
I'm trying to avoid having to implement a separate intent receiver class.
You have no choice -- an Intent
used with sendBroadcast()
is not going to be received by an activity any other way. Do not confuse startActivity()
Intents
with sendBroadcast()
Intents
.
精彩评论