Jeffrey Blattman wrote:
> this has to be a simple answer. i have code that calls a broadcast
> receiver, in the receiver, i try to get the extra data from the intent,
> but it's null.
>
> so,
>
> / Intent i = new Intent("test", null, context,
> MyReceiver.class);
> i.putExtra("org.jtb.name", "blah");
> context.sendBroadcast(i);/
>
> and in the BroadcastReceiver.onReceiver(),
>
> / String name = i.getStringExtra("org.jtb.name");/
>
> but name is null. what am i missing?
Try using a simpler constructor:
Intent i = new Intent(context, MyReceiver.class);
and see if that helps.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
_Beginning Android_ from Apress Now Available!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---