gpt4 book ai didi

android - 使用 Intent.ACTION_SENDTO 时在哪里指定电话号码?

转载 作者:行者123 更新时间:2023-11-30 00:23:25 26 4
gpt4 key购买 nike

here , 下面给出例子:

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

目的地号码指定在哪里?

最佳答案

Uri uri = Uri.parse("smsto:xxxxxxxxxx");
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);

关于android - 使用 Intent.ACTION_SENDTO 时在哪里指定电话号码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45866099/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com