1. 调用系统发送短信界面(并指定短信接收人和短信内容)

Uri smsToUri = Uri.parse("smsto:10086");
Intent mIntent = new Intent(android.content.Intent.ACTION_SENDTO, smsToUri );
mIntent.putExtra("sms_body", "The SMS text");
startActivity( mIntent );

2. 调用系统已发送短信界面

Uri smsUri = Uri.parse("smsto:106900867734");
Intent intent = new Intent(Intent.ACTION_MAIN, smsUri)

intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);

这里我们使用action_main 根据api显示提示

android.content..ACTION_MAIN = "android.intent.action.MAIN"

public static finalACTION_MAINSince:

Activity Action: Start as a main entry point, does not expect to receive data.

Input: nothing

Output: nothing

Constant Value:"android.intent.action.MAIN"

下面这种操作其实不推荐,因为传递的smsto并无法接收。

Uri smsUri = Uri.parse("smsto:106900867734");
Intent intent = new Intent(Intent.ACTION_VIEW,smsUri)

intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);

根据api提示:

android.content..ACTION_VIEW = "android.intent.action.VIEW"

public static finalACTION_VIEWSince:

Activity Action: Display the data to the user. This is the most common action performed on data -- it is the generic action you can use on a piece of data to get the most reasonable thing to occur. For example, when used on a contacts entry it will view the entry; when used on a mailto: URI it will bring up a compose window filled with the information supplied by the URI; when used with a tel: URI it will invoke the dialer.

Input:is URI from which to retrieve data.

Output: nothing.

Constant Value:"android.intent.action.VIEW"

更多相关文章

  1. 修正android cocos2dx项目当点击属性时提示错误的问题
  2. Android中的android.provider.Settings.System系统属性设定
  3. Android(安卓)-- 零散记录[短信发送,系统拨号,单元测试]
  4. Android调用系统, 任意比例裁剪图片
  5. android 调用系统 录像,录音等
  6. 解决Android(安卓)Studio 无法在线更新的问题
  7. android启动界面
  8. android用户界面之Widget教程实例汇总
  9. This Android(安卓)SDK requires Android(安卓)Developer Toolki

随机推荐

  1. android 开发-Toast控件的实现
  2. Android实现文字垂直滚动、纵向走马灯效
  3. Android中Handle总结
  4. Process 'command 'D:\SDK\ndk-bundle/
  5. 第三方Android(安卓)软件商店:现状和思考
  6. android studio git 上传代码,分支,tag,回退
  7. 2011 APP年终总结——日均160元的收入经
  8. android电话系统和ril分析(2)————rild
  9. Android之intents and intentFilters
  10. android状态栏中多个通知冲突的问题