I don't see off-hand why that wouldn't work.  To help, while your
application is running you can from the shell run "adb shell dumpsys
activity.receivers" to see all of the receivers that are currently
registered, to make sure yours is their and registered under the
filter you expect.

On Mar 23, 2:17 pm, chris <[EMAIL PROTECTED]> wrote:
> Hi I have a little problem with intents and intentreceiver
>
> I have an application that stay at top and a service running in the
> background.
>
> I'm trying to broadcast an intent from the service to the activity.
>
> i'm broadcasting the intent from the service with this code :
> Log.i(TAG,"Message : USER_ID :"+res.elementAt(0));
>
> Intent intent= new Intent( RECEIVED_MESSAGE_INTENT);
> BundledMessage msg=new BundledMessage(res);
> intent.putExtras(msg.getBundle());
> broadcastIntent(intent);
>
> in my activity , i have an intentreceveir as an innerclass , an
> intentfilter and i'm registering the intent with this code :in
> onCreate() :
> myIntentFilter=new IntentFilter();
> myIntentFilter.addAction(MessagesRetrieverService.RECEIVED_MESSAGE_INTENT);
> this.myIntentReceiver = new MyIntentReceiver();
> ...
> this.registerReceiver(this.myIntentReceiver, this.myIntentFilter);
>
> class MyIntentReceiver extends IntentReceiver {
> @Override
> public void onReceiveIntent(Context context, Intent intent) {
> Log.v(TAG, "intent:"+intent.getAction());
>
> }
> }
>
> I see the log before sending the intent and no exception so the intent
> should be brodcasted , but the intent is never cought by the intent
> receiver as i never see anything in the log (i should see the name of
> the intent).
>
> Does anyone see what did i miss ?
>
> Chris
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to