Im writing an app that sends an SMS to several contacts. The contacts numbers are stored in an ArrayList
(was received from another activity). I am not able to use this ArrayList
to pass several contacts to the built-in SMS android app. This is the code:
ArrayList<String> numbersArrayList=getIntent().getExtras().getStringArrayList("phoneNumbers");
String message= "this is a custom message";
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.putExtra("sms_body", message);
smsIntent.putExtra("address", ??????????);
smsIntent.setType("vnd.android-dir/mms-sms");
startActivity(smsIntent);
I can iterate and print these contacts to the LogCat the simple "for each" loop and overriding toString method.