Reputation: 16244
In here, the following example is given:
public void composeMmsMessage(String message, Uri attachment) {
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setType(HTTP.PLAIN_TEXT_TYPE);
intent.putExtra("sms_body", message);
intent.putExtra(Intent.EXTRA_STREAM, attachment);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
Where is the destination number specified?
Upvotes: 1
Views: 182
Reputation: 1419
Uri uri = Uri.parse("smsto:xxxxxxxxxx");
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
Upvotes: 1
Reputation: 1006964
It isn't. That's a bug in that code. ACTION_SENDTO
takes an smsto:
or mailto:
Uri
:
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:123456"));
where 123456 is the desired phone number.
Upvotes: 0