title: Unable to send sendBroadcast from SyncAdapter to Activity
body: <p>I have an application with a <code>SyncAdapter</code> that runs fine. The <code>SyncService</code> runs once per hour.</p>
  
  <p>My application has a main <code>FragmentActivity</code> called <code>DeviceControlActivity</code> and I would like to receive messages from the SyncAdaptor, such as the <code>syncResult</code>.</p>
  
  <p>I've tried a lot to get it up and running, but I'm not able to receive any messages on <code>DeviceControlActivity</code> from <code>SyncAdapter</code>.</p>
  
  <p>In my <code>DeviceControlActivity</code> I do:</p>
  
  <pre><code>private BroadcastReceiver mSyncMessageReceiver = new BroadcastReceiver() {
      @Override
      public void onReceive(Context context, Intent intent) {
          Log.d(TAG, "Got it!");
      }
  };
  
  @Override
  protected void onResume() {
      super.onResume();
      // Receive feedback from syncManager
      LocalBroadcastManager.getInstance(getApplication()).registerReceiver(mSyncMessageReceiver,
              new IntentFilter(Constants.MESSAGE_SYNC));
  }
  
  @Override
  protected void onPause() {
      super.onPause();
      LocalBroadcastManager.getInstance(this).unregisterReceiver(mSyncMessageReceiver);
  }
  </code></pre>
  
  <p>On the SyncAdapter, I have:</p>
  
  <pre><code>private LocalBroadcastManager mBroadcastManager;
  
  public SyncAdapter(Context context, boolean autoInitialize) {
      super(context, autoInitialize);
  
  
      mBroadcastManager = LocalBroadcastManager.getInstance(context);
  }
  
  @Override
  public void onPerformSync(
          Account account,
          Bundle extras,
          String authority,
          ContentProviderClient provider,
          SyncResult syncResult) {
  
      Intent intent = new Intent(Constants.MESSAGE_SYNC);
      mBroadcastManager.sendBroadcast(intent);
  </code></pre>
  
  <p>I can send messages from <code>DeviceControlActivity</code> to itself and it works.</p>
  
  <p>I can receive messages from the SyncService, but using an alternative way:</p>
  
  <pre><code>final int mask = ContentResolver.SYNC_OBSERVER_TYPE_PENDING | ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE;
  mSyncMonitor = ContentResolver.addStatusChangeListener(mask, this);
  </code></pre>
  
  <p>This listener reports the sync activity as expected.</p>
  
  <p>But I would like to use a LocalBroadcastManager to communicate between the Service and the Activity, but I'm not able.</p>
  
  <p>I've already check related questions like <a href="https://stackoverflow.com/questions/8802157/how-to-use-localbroadcastmanager">How to use LocalBroadcastManager?</a></p>