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