Android BroadcastReceiver won't work

前端 未结 1 1308
失恋的感觉
失恋的感觉 2020-12-20 01:07

I have a really simple problem which is driving me nuts. I am creating a BroadcastReceiver, declaring it on the manifest but it just wont run. I\'m trying to make it trigger

相关标签:
1条回答
  • 2020-12-20 02:01

    Do you have some Activity which user can launch?

    If not this is your problem! Since android 3.1 after installation application (package to be more specific) is in stopped state and doesn't receive ANY broadcast. User have to launch it manually at lest once to make it work. See section "Launch controls on stopped applications" in release notes of Android 3.1.
    See also flags FLAG_INCLUDE_STOPPED_PACKAGES, FLAG_EXCLUDE_STOPPED_PACKAGES.

    0 讨论(0)
提交回复
热议问题