so i'm new to android development and I was just trying to program a simple app that when open sends a text to a specific number then closes it self. The app works fine except that when I run the app it sends 3 sms's. How can I fix this so it only sends one? Here is my code (The app also requests permision to send_sms):
package com.example.texter;
import android.app.Activity;
import android.os.Bundle;
import android.telephony.SmsManager;
public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("+11234567890", null, "message", null, null);
finish();
}
}
Thanks in advance.