发送组短信android

发送组短信android,android,Android,我需要一个应用程序,如组消息。为此,我使用了SmsManager类 我的代码看起来像 static List<String> phone_num = new ArrayList<String>(); static List<String> SMS = new ArrayList<String>(); @Override public void onCreate(Bundle savedInstanceState) { sup

我需要一个应用程序,如组消息。为此,我使用了SmsManager类

我的代码看起来像

    static List<String> phone_num = new ArrayList<String>();
static List<String> SMS = new ArrayList<String>();

   @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
            readExcelFile(this, "/sdcard/Excel.xls");
    View readExcelButton = findViewById(R.id.buttonSend);
            readExcelButton.setOnClickListener(this);

}


      public void onClick(View v) {
        switch (v.getId()) {
        case R.id.buttonSend:
          for(int i=0;i<phone_num.size();i++)
            {
               SmsManager smsManager = SmsManager.getDefault();
               smsManager.sendTextMessage(phone_num.get(i),SMS.get(i), null, null);        
                }

  Toast.makeText(getBaseContext(), "Sendingfinished",Toast.LENGTH_SHORT).show();  


                break;
       default: break;
        }
    }
static List phone_num=new ArrayList();
静态列表SMS=newArrayList();
@凌驾
创建时的公共void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
readExcelFile(该文件为“/sdcard/Excel.xls”);
查看readExcelButton=findViewById(R.id.buttonSend);
readExcelButton.setOnClickListener(此);
}
公共void onClick(视图v){
开关(v.getId()){
案例R.id.按钮发送:
对于(int i=0;i