BroadcastReceiver issues in Android 3.1+

后端 未结 2 1664
天涯浪人
天涯浪人 2021-01-15 12:27

I\'m trying to update location data to a web database using BroadcastReceiver and Service.

However I am having difficulties making it to wo

相关标签:
2条回答
  • 2021-01-15 13:01

    Check this out: Boot Complete problems

    0 讨论(0)
  • 2021-01-15 13:04

    since android 3, all components in an app are prevented from running (receiving broadcasts) until the app is explicitly started by the user.

    to test if this is your problem, add a dummy activity to your app and start it. now your app should be able to receive intents from then on (even after a reboot).

    here's the AOSP issue describing the problem,

    http://code.google.com/p/android/issues/detail?id=18225

    note that it's closed as "works as intended". this is technically a security fix. apps could exploit certain well-known broadcast intents like TIMER_TICK to start themselves without the user ever running the app or knowing that the app was running.

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