The class below sends and SMS message onLocationChange of the GPS,
well I want it to anyway.

Alone it works fine, but as a class it doesn't.  If I comment out the
code in sendSMS() the program doesn't crash on the phone but it also
doesn't send the SMS.  The same code runs as a standalone sends SMS
just fine.

SMS Class
package xxx.xxxx.xxx.sms;

import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.telephony.SmsManager;

public class SimpleSMS extends Activity {

public void sendSMS(String phoneNumber, String message) {
                  PendingIntent pi = PendingIntent.getActivity(this, 0,new
Intent(this, SimpleSMS.class), 0);
                  SmsManager sms = SmsManager.getDefault();
                  sms.sendTextMessage(phoneNumber, null, message, pi,
null);
                }
}
>>------------------------------------------------------<<

This is how I use the class
SimpleSMS sms                           =               new SimpleSMS();

sms.sendSMS(phoneNo, v);  \\ v is gps coordinates

-- 
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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to