0%

Android调用系统短信发送界面并预设接收号码、短信内容

很简单的几句代码,也是通过Intent来实现:

            Uri smsToUri = Uri.parse("smsto:10086");
            Intent intent = new Intent( android.content.Intent.ACTION_SENDTO, smsToUri );
            intent.putExtra("sms_body", "这是内容");
            startActivity( intent );

其中第一句smsto后面是是目标号码,如果不设的话,直接就smsto:就行,后面的sms_body对应预设内容,不需要可以整句删除。