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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to