android:sms
来源:互联网 发布:鲁班软件 上市 编辑:程序博客网 时间:2024/06/18 10:10
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/numberinput" /> <EditText android:id="@+id/number" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="number" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/contentsms" /> <EditText android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minLines="3" android:inputType="text" /> <Button android:id="@+id/send" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button" /></LinearLayout>
package com.example.sms;import java.util.List;import android.app.Activity;import android.os.Bundle;import android.telephony.SmsManager;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class SMSActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);final EditText text01 = (EditText) this.findViewById(R.id.number);final EditText text02 = (EditText) this.findViewById(R.id.content);Button btnSend = (Button) this.findViewById(R.id.send);btnSend.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {String mobile = text01.getText().toString();String content = text02.getText().toString();SmsManager smsManager = SmsManager.getDefault();List<String> texts = smsManager.divideMessage(content);for (String text : texts) {smsManager.sendTextMessage(mobile, null, text, null, null);}Toast.makeText(SMSActivity.this, "success", Toast.LENGTH_LONG).show();}});}}
0 0
- android Sms
- android sms
- android:sms
- android sms
- Android SMS
- android SMS
- SMS Messaging in Android
- Android SMS 表结构
- Android SMS相关操作
- Android SMS 小结
- android 发送短信sms
- Android 之 sms 短信
- Android 发送短信 sms
- Android SMS PDU
- android 发送 SMS 详解
- Android SMS 短信操作
- android之SMS
- android 发送 SMS 详解
- Populating Next Right Pointers in Each Node II
- ADF Mobile 11g 架构
- 并查集
- 1408202044-hd-How many prime numbers.cpp
- 存储过程与函数的区别
- android:sms
- TreeMap类的entrySet()方法的应用
- Libgdx的使用(17)——多语言和国际化
- ADF工具类:TaskFlowUtils.java 源代码
- AspectJ学习笔记1-报Invalid aspectj.home.的处理方法
- 组件自动绑定到Managed Bean功能
- 杭电1059 Dividing(多重背包解法)
- Jquery超简单遮罩层实现代码
- 【二分+半平面交】 HDOJ 3761 Jungle Outpost