码迷,mamicode.com
首页 > 其他好文 > 详细

SMS消息传递

时间:2017-02-09 23:59:48      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:sms   android   

<Button
    android:id="@+id/send"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Send SMS"
    android:onClick="onClick"/>
public void onClick(View view){
    sendSMS("5556","Hello...");
    Toast.makeText(this,"hello",Toast.LENGTH_SHORT).show();
}

private void sendSMS(String s, String s1) {
    SmsManager smsManager = SmsManager.getDefault();
    smsManager.sendTextMessage(s,null,s1,null,null);

}


SMS消息传递

标签:sms   android   

原文地址:http://8318064.blog.51cto.com/8308064/1896532

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!