拨打电话号码或发送消息的最佳方式
Best way to make call number or send a menssage
我想要的是 name = textview 中的 onclick,它会弹出一个 window,其中有 2 个按钮,1 个按钮用于 phone 通话,其他按钮用于短信。
先google一下吧。什么是 alertdialog 框,然后通过单击按钮使用
拨打电话
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phone1.getText().toString()));
其中 phone1 是一个 EditText
并发送短信喜欢
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));
intent.putExtra("sms_body", message);
startActivity(intent);
希望你得到你想要的
我想要的是 name = textview 中的 onclick,它会弹出一个 window,其中有 2 个按钮,1 个按钮用于 phone 通话,其他按钮用于短信。
先google一下吧。什么是 alertdialog 框,然后通过单击按钮使用
拨打电话Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phone1.getText().toString()));
其中 phone1 是一个 EditText 并发送短信喜欢
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));
intent.putExtra("sms_body", message);
startActivity(intent);
希望你得到你想要的