當前位置:
首頁 >
linux 短信功能,Android调用系统短信功能发送短信
發布時間:2023/12/4
58
豆豆
生活随笔
收集整理的這篇文章主要介紹了
linux 短信功能,Android调用系统短信功能发送短信
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Android調用系統短信功能發送短信有兩種方法:
第一種,設定發送的號碼,和內容,界面沒有聯系人,群組組等按鈕,如下圖所示:
代碼如下:
Uri smsToUri = Uri.parse("smsto:114");// 聯系人地址
Intent mIntent = new Intent(android.content.Intent.ACTION_SENDTO,
smsToUri);
//? ?EditText et=(EditText) findViewById(R.id.smsContent);
mIntent.putExtra("sms_body", "短信內容www.linuxidc.com");// 短信內容
this.startActivity(mIntent);
第二種,設定發送短信內容,不設置發送的號碼,界面有聯系人,群組等按鈕,如下圖所示:
代碼如下:
Uri smsUri = Uri.parse("smsto:");
Intent intent = new Intent(Intent.ACTION_VIEW, smsUri);
intent.putExtra("sms_body", "短信內容");
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的linux 短信功能,Android调用系统短信功能发送短信的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: A站、B站、C站、D站、E站各是什么意思
- 下一篇: 台电x80plus装linux,纤巧却不