2011-03-27 49 views

回答

1

它可以通过几种不同的方式完成。这里有一个:

Intent sendIntent = new Intent(Intent.ACTION_VIEW); 
sendIntent.putExtra("sms_body", "Content of the SMS goes here..."); 
sendIntent.setType("vnd.android-dir/mms-sms"); 
startActivity(sendIntent); 
+0

谢谢!对此,我真的非常感激!! – dksxogudsla 2011-03-30 04:04:33

0
Here "number" is an array of strings with the numbers of contacts to whom you want to send sms to and "älldetails" is teh string you want to send. 


String n = ""; 
for(int i = 0; i<sizesf ;i++) 
{ 
     if(i == (sizesf-1)) 
     { 

      n = n + number[i]; 
     } 

     else 
      n = n + number[i] + ";"; 

} 


Log.d("numbers in intent", n); 

Intent smsIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("smsto:"+ n)); 
smsIntent.setType("vnd.android-dir/mms-sms"); 
smsIntent.putExtra("address", n); 
smsIntent.putExtra("sms_body",alldetails); 
startActivity(smsIntent); 

}

相关问题