Things to try:
1. Use sentIntent instead of deliveryIntent:
.sendTextMessage("5554", null, "Example", pi, null);
2. Register the receiver statically in the manifest instead of
registering it dynamically at runtime.
I don't know when this makes a difference but it seems to in this
case.
3. Set explicit class in intent:
intent.setClass(context, myExampleReceiver.class)
Joe
On Mar 3, 6:49 pm, "Mr. S" <[email protected]> wrote:
> Hello
>
> I'm trying to implement the SMSManager.sendTextMessage class to
> populate a conversation when a message is delivered and cannot get the
> pendingIntent (final parameter) in the method to send. I will put an
> example of what I am trying to do below for explanations sake:
>
> -------------- START EXAMPLE
>
> public class ExtendedService extends Service {
>
> public static final String INTENT_SIGNITURE = "example";
>
> public void onStart(Intent intent, int startId){
>
> registerReceiver(mExampleReceiver, new
> IntentFilter(INTENT_SIGNITURE));
> PendingIntent pi = PendingIntent.getBroadcast(this, 0, new
> Intent(INTENT_SIGNITURE), 0);
>
> SmsManager.getDefault().sendTextMessage("5554", null, "Example",
> null, pi);
>
> }
>
> final BroadcastReceiver mExampleReceiver = new BroadcastReceiver(){
> public void onReceive(Content context, Intent intent){
> System.out.println("Success has happened");
> }
>
> }
>
> ------------- END EXAMPLE ------------
>
> Please excuse any syntax errors as it is jsut an example, but that is
> the gist. In this case, the System.out.println would not execute.
>
> At this point i'm convinced either the method has something wrong with
> it or the context of the Service prevents it from firing? (I would
> need an explanation there)
>
> I have tested on two Vista machines and on a Moto Droid.
>
> Any help would be appreciated as I am using a hack as a workaround to
> this and would prefer a more elegant design.
>
> Thanks in advance.
--
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