Monday, May 31, 2010

[android-developers] Re: SendOrderedBroadcast Help



    sendOrderedBroadcast(i, null, domainBroadcast, null, Activity.RESULT_OK, null, null);


    class DomainBroadcast extends BroadcastReceiver{
        public void onReceive(Context arg0, Intent intent) {
            String action = intent.getAction();
                Log.d("BROADCAST", "Returning broadcast");
                Bundle b = intent.getExtras();
                Log.d("BROADCAST", "Returning broadcast " +


        public void onReceive(Context context, Intent intent) {
                String action = intent.getAction();
                    Bundle b = intent.getExtras();
                    int testQCLevel = b.getInt("com.testnetworks.QCLEVEL");
                    case 1:
                        Log.d("QCLevel ", "QCLevel = UNAVAILABLE");
                    case 2:
                        Log.d("QCLevel ", "QCLevel = BELOWUSABILITY");
                    case 3:
                        Log.d("QCLevel ", "QCLevel = VOICE");
                    intent.putExtra("com.testnetworks.INT_TEST", 100);


So according to the Doc's I should recieve 100 back in my DomainBroadcast reciever but it always comes back as 0.

Can anyone see why?

On Mon, May 31, 2010 at 2:03 PM, <> wrote:

I am trying to use a sendOrderedBroadcast in my Android app.

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.

Here is the current code:

   Intent i = new Intent();
   sendOrderedBroadcast(i, null, null, null, Activity.RESULT_OK,
null, null);

Is this the correct way to achieve what I want?

If so what do I use as the resultReceiver* parameter? (3rd parameter)

And then how to I recieve data back from the Broadcast?

I have done a quick google and not come up with any examples, any help
or examples greatly appreciated.

*resultReceiver - Your own BroadcastReceiver to treat as the final
receiver of the broadcast.

You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment