It compiles without any errors in Eclipse, and when I comment it out, the application does not crash, but somewhere in here it is making my application crash on startup. Does anyone know how to fix this problem?
Button send_button = (Button)findViewById(R.id.SendButton);
spam_button.setOnClickListener((OnClickListener) this);
phone_number = (TextView)findViewById(R.id.ph_num);
txt_body = (TextView)findViewById(R.id.TextBody);
}
public void onSendClick(View v)
{
dest_addr = (String) txt_body.getText();
body = (String) txt_body.getText();
if(send == 0) {
send = 1;
startSend();
}
else {
send = 0;
}
}
private void startSend() {
SmsManager sms = SmsManager.getDefault();
if(send == 1) {
sms.sendTextMessage(dest_addr, null, body, null, null);
}
else
{
sms = null;
}
}
}
Is it something wrong with my permissions in AndroidManifest? I added the "SMS_SEND" permission to it. That should be all I need. I am using the Android 2.1 target. Please let me know if there is anything I am doing wrong. Thanks for your help.
-fuggles