0

I have developed an app which only has a BroadcastReceiver (no Activity + no Service) - its for a specific purpose.

I was able to test my app on v2.3.3 and it works perfectly well. Will it work the same on all platforms or there are exceptions to this? If there are - what could be alternative(s)?

Mahendra Liya
  • 12,912
  • 14
  • 88
  • 114

1 Answers1

3

No, it will not work on all versions.

Starting Android 3.1 (API 12), you cannot receive broadcasts until a UI component of your app (an Activity) has been manually opened by the user at least once.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
  • Thank you for the link (I was looking for it but couldn't locate). What are your views on this: "A background service or application can override this behavior by adding the FLAG_INCLUDE_STOPPED_PACKAGES flag to broadcast intents that should be allowed to activate stopped applications."? – Mahendra Liya Mar 26 '13 at 12:05
  • 1
    @Mahendra That means that when an app sends a broadcast, it can include that flag to make all apps receive it. However, you cannot make other apps add it – Raghav Sood Mar 26 '13 at 12:51