是否有类似<a href="tel:...">
的短信链接。行为是类似的,但它不会调用数字,而是提示用户发送文本?
答案 0 :(得分:25)
尝试使用:
<a href="sms://+14035550185?body=I%27m%20interested%20in%20your%20product.%20Please%20contact%20me.">Send a SMS message</a>
您可以使用body参数对文本中的消息进行排队。
答案 1 :(得分:0)
短信链接的基本格式为
RadioButton first= findViewById(R.id.first);
first.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick(View v) {
new AlertDialog.Builder(Testing.this)
.setTitle("Change theme?")
.setMessage("Are you sure you want to change theme of button?")
// Specifying a listener allows you to take an action before dismissing the dialog.
// The dialog is automatically dismissed when a dialog button is clicked.
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
first.setChecked (true);
first.setBackground (getDrawable (R.drawable.your_no_theme_name));
}
})
.setNegativeButton (android.R.string.no, new DialogInterface.OnClickListener () {
@Override
public void onClick(DialogInterface dialog, int which) {
first.setChecked (false);
first.setBackground (getDrawable (R.drawable.your_yes_theme_name));
}
})
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
}
});
答案 2 :(得分:-2)
WhatsApp提供发送文本的选项。
<a href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share">Share via Whatsapp</a>