title: What is the simplest way to send message from local service to activity
body: <p>I have a service which is listening to the phone.  When the phone goes IDLE, I want to send a message to my Activity.  It looks like I have two options to accomplish this.  BroadcastReceiver and binding to the Service.  BroadcastReceiver looked like an easier mechanism, so I tried the following test.</p>
  
  <p>In my Activity:</p>
  
  <pre><code>@Override
  protected void onStart() {
      super.onStart();
      IntentFilter filter = new IntentFilter("MyAction");
      registerReceiver(new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {
              Log.d(TAG, "Yay.......");
              abortBroadcast();
          }
      }, filter);
  }
  </code></pre>
  
  <p>In my Service which is listening for events, when I detect my desired event:</p>
  
  <pre><code>    Intent localIntent = new Intent(_context, MainActivity.class);
      intent.setAction("MyAction");
      _context.sendOrderedBroadcast(localIntent, null);
  </code></pre>
  
  <p>In my test, the onReceive() method is never called after I have watched the broadcast being sent with the debugger.  What am I missing?  Also, is a BroadcastReceiver the simplest way for a local service to communicate with an Activity?</p>