2009/7/25 Mark Murphy <[email protected]>

>
> > I'm building a service that sends a broadcast intent when some value
> > changes.
> > The service sends the broadcast like this:
> >
> > Intent broadcastIntent = new Intent();
> > broadcastIntent.setAction("nl.vu.contextframework.NEWREADING");
> > broadcastIntent.setData(Uri.parse("context://"+cer.getKey()));
> > broadcastIntent.putExtra("reading",cer);
> > broadcastIntent.addCategory("nl.vu.contextframework.CONTEXT");
> > sendBroadcast(broadcastIntent);
> >
> >
> > In some Activity (in a different process), I'm tryint to receive this
> > broadcast as follows:
> >
> >
> > IntentFilter intentFilter = new IntentFilter();
> > intentFilter.addDataScheme("context");
> > intentFilter.addCategory(CATEGORY_CONTEXT);
> >
> > registerReceiver(new BroadcastReceiver() {
> >   public void onReceive(Context context, Intent intent) {
> >     Log.d(TAG,"Received intent "+intent);
> >   }
> > }, intentFilter);
> >
> >
> > The intent is never received though. What am I doing wrong? Does my
> > intentfilter not match the intent?
>
> Does:
>
> "nl.vu.contextframework.CONTEXT"
>
> equal:
>
> CATEGORY_CONTEXT
>
>

Yes it does. I just double checked.
Could it be that I'm using a non-existent scheme?
I invented "context://" myself, maybe this is not a good idea?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to