title: Android - sendOrderedBroadcast help
body: <p>I am trying to use a <a href="http://developer.android.com/intl/de/reference/android/content/Context.html#sendOrderedBroadcast%28android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle%29" rel="noreferrer">sendOrderedBroadcast</a> in my Android app.</p>
  
  <p>I want to be able to send the Intent from one of my applications to another and I then want to get data back from the Application that recieves the Intent, in this case a boolean true or false.</p>
  
  <p>Here is the current code:</p>
  
  <pre><code>    Intent i = new Intent();
      i.setAction(GlobalData.PROPOSE_IN_DOMAIN_ROAM_INTENT);
      i.putExtra("com.testnetworks.QCLEVEL", aProposedTheoreticalQoSLevel);
      sendOrderedBroadcast(i, null, null, null, Activity.RESULT_OK, null, null);
  </code></pre>
  
  <p>Is this the correct way to achieve what I want?</p>
  
  <p>If so what do I use as the resultReceiver* parameter? (3rd parameter)</p>
  
  <p>And then how to I recieve data back from the Broadcast?</p>
  
  <p>I have done a quick google and not come up with any examples, any help or examples greatly appreciated.</p>
  
  <p><strong>UPDATED CODE:</strong></p>
  
  <hr>
  
  <pre><code>sendOrderedBroadcast(i, null, domainBroadcast, null, Activity.RESULT_OK, null, null);
  </code></pre>
  
  <hr>
  
  <pre><code>class DomainBroadcast extends BroadcastReceiver{
  
      @Override
      public void onReceive(Context arg0, Intent intent) {
          String action = intent.getAction();
  
          if(GlobalData.PROPOSE_IN_DOMAIN_ROAM_INTENT.equals(action)){
              Log.d("BROADCAST", "Returning broadcast");
  
              Bundle b = intent.getExtras(); 
              Log.d("BROADCAST", "Returning broadcast " + 
                      b.getInt("com.testnetworks.INT_TEST"));
          }      
      }
  </code></pre>
  
  <hr>
  
  <pre><code>    @Override
      public void onReceive(Context context, Intent intent) {
              String action = intent.getAction(); 
  
              if(GlobalData.PROPOSE_IN_DOMAIN_ROAM_INTENT.equals(action)){
  
                  Bundle b = intent.getExtras();
                  int testQCLevel = b.getInt("com.testnetworks.QCLEVEL");
                  switch(testQCLevel){
                  case 1:
                      Log.d("QCLevel ", "QCLevel = UNAVAILABLE");
                      break;
                  case 2:
                      Log.d("QCLevel ", "QCLevel = BELOWUSABILITY");
                      break;
                  case 3:
                      Log.d("QCLevel ", "QCLevel = VOICE");
                      break;
                  }
  
                  intent.putExtra("com.testnetworks.INT_TEST", 100);
  
            }
  </code></pre>
  
  <hr>
  
  <p>So according to the Doc's I should recieve 100 back in my DomainBroadcast reciever but it always comes back as 0.</p>
  
  <p>Can anyone see why?</p>
  
  <p>**resultReceiver - Your own BroadcastReceiver to treat as the final receiver of the broadcast.*</p>