android之拨打电话、发送短信
2014-03-12 21:07
417 查看
// 发送短信
public static void goSMS(Context context, String tel, String content) {//tel为要发送的电话号码、content为要发送的内容
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + tel));
intent.putExtra("sms_body", content);
context.startActivity(intent);
}
// 拨打电话(直接拨打)
public static void goTel(Context context, String tel, String content) {
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + tel));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
// 拨打电话(显示拨打界面)
public static void gotoTel(Context context, String tel) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tel));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
public static void goSMS(Context context, String tel, String content) {//tel为要发送的电话号码、content为要发送的内容
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + tel));
intent.putExtra("sms_body", content);
context.startActivity(intent);
}
// 拨打电话(直接拨打)
public static void goTel(Context context, String tel, String content) {
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + tel));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
// 拨打电话(显示拨打界面)
public static void gotoTel(Context context, String tel) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tel));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
相关文章推荐
- android之无法登陆google play解决方法
- Android 语音识别+语音搜索源码 Voice Search
- Android 命名规范
- android之获取当前系统时间
- android api 完整通译之Contacts Provider (学习安卓必知的api,中英文对照)
- Android HandlerThread 的使用及其Demo
- android之获取应用版本号、版本名
- android测试之getevent/sendevent
- android 自定义主题样式
- Android - AndroidManifest.xml - Provider
- Android中shape的使用
- Android自定义适配器,BaseAdapter的使用方法
- 科大讯飞(语音合成和语音听写)
- android之横屏、全屏
- Android系统进程Zygote启动过程的源代码分析
- android之动态设置控件高宽
- android4.0下serial port给应用操作完成特殊定制
- android SDK安装后设置环境变量
- android多线程的实现方法
- Android初学常见问题