I want to have an Android activity that overrides the Synchronisation Settings for my Account type. In the manifest file I have an intent-filter under my activity as follows:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.settings.ACCOUNT_SYNC_SETTINGS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
However, I am now getting a “Complete action using” dialog if I select any account in the “Accounts and Sync” settings screen. Is there anything I can do to make sure my activity is automatically chosen for my account type and never an option for any other account type?.
Broadcast receivers are Android’s implementation of the Publish/Subscribe messaging pattern, more precisely is an Observer pattern. Applications (known as publishers) can generate broadcasts to simply send events not knowing who, if anyone, will get them. Receivers (known as subscribers) that want the information subscribe to specific messages via filters. If the message matches a filter, the subscriber is activated (if it’s not already running) and notified of the message.
So, you can only receive a broadcast message, you cannot prevent other applications registered for the same message.