开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜