`
xidajiancun
  • 浏览: 463474 次
文章分类
社区版块
存档分类
最新评论

调用Android发短信接口Intent.ACTION_SENDTO

 
阅读更多

调用Android发短信接口Intent.ACTION_SENDTO

	public void welcome_register(View v) {
//		测试smsto
		Uri sms_uri= Uri.parse("smsto:13517596490");//设置号码
		Intent sms_intent = new Intent(Intent.ACTION_SENDTO,sms_uri);//调用发短信Action
		sms_intent.putExtra("sms_body", "HelloWorld");//用Intent设置短信内容
		startActivity(sms_intent);
//		String qqRegiter = this.getString(R.string.QQRegiter);// 获取资源中的字符串
//		if (qqRegiter != null && !(qqRegiter.equals(""))) {
//			Uri uri = Uri.parse(qqRegiter);// 设置一个统一资源定位符
//			Intent intent = new Intent(Intent.ACTION_VIEW, uri);// 展示一个新的View
//			startActivity(intent);
//		}
	}


分享到:
评论

相关推荐

    android Intent实例

    returnIt = new Intent(Intent.ACTION_SENDTO, emailUri); 9,发邮件 returnIt = new Intent(Intent.ACTION_SEND); String[] tos = { "shenrenkui@gmail.com" }; String[] ccs = { "shenrenkui@gmail.com" }; ...

    android常用的API接口调用

    要在 Android 应用程序中发送短信或彩信,可以使用 Intent.ACTION_VIEW 动作和 Uri.parse() 方法来解析短信或彩信的内容。例如: ```java Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body", ...

    android常用意图

    若要发送带有短信内容的Intent,可以使用`Intent.ACTION_SENDTO`并设置额外的数据。 以上是Android中常见的Intent用法,它们极大地简化了应用间的交互,使得开发者可以轻松地调用系统服务或第三方应用功能。在实际...

    Android系统调用[定义].pdf

    发送短信通过ACTION_SENDTO Intent,使用smsto: Uri scheme,并设置短信内容。 ```java Uri uri = Uri.parse("smsto:0800000123"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", ...

    androidIntent使用技巧.pdf

    调用发短信的程序可以使用`ACTION_VIEW`动作: ```java Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body", "The SMS text"); it.setType("vnd.android-dir/mms-sms"); startActivity(it);...

    android用Intent调用常用的系统组件

    6. **调用发短信的程序** 打开短信应用,预填充短信内容。 ```java Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body", "The SMS text"); it.setType("vnd.android-dir/mms-sms"); start...

    android_intent和intent_action大全

    在Android开发中,Intent是一种非常重要的机制,用于在应用程序组件之间进行通信,它可以用来启动其他组件,如Activity、...在开发过程中,合理使用Intent和IntentAction可以极大地提高应用程序的功能性和用户体验。

    androidIntent介绍.pdf

    6. **调用发短信程序**: 发送短信通常有两种方式,一种是启动短信编辑界面,另一种是直接发送。 - 启动短信编辑界面: ```java Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body", "The ...

    android Intent使用技巧.pdf

    6. **调用发短信程序** 若要启动短信应用并预填短信内容,可以使用`ACTION_VIEW`和`setType()`。 ```java Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body", "The SMS text"); it.setType...

    Android Intent的几种用法全面总结

    Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", "The SMS text"); startActivity(it); ``` 6. 发送彩信: 发送带有图片的彩信: ```java Uri uri = Uri.parse("content://media/...

    android intent和intent action大全.doc

    6. **调用发短信的程序** 若要启动短信编写界面,使用`ACTION_VIEW`并指定短信内容。注意,这只会启动短信应用,不会自动发送。 ```java Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body",...

    Android Intent 用法汇总.doc

    - 发送短信:`Intent it = new Intent(Intent.ACTION_VIEW, uri); it.putExtra("sms_body", "The SMS text"); it.setType("vnd.android-dir/mms-sms"); startActivity(it);`会打开短信应用,预填短信内容。 - 传送...

    Android中使用Intent启动信息发送功能的方法介绍.pdf

    2. **调用发短信程序** 若要直接启动短信发送功能,可以使用ACTION_VIEW或ACTION_SENDTO动作。下面是一些示例: - 使用ACTION_VIEW: ```java Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_...

    android的intent跳转

    Intent intent = new Intent(Intent.ACTION_SENDTO, smsUri); intent.putExtra("sms_body", "短信内容"); startActivity(intent); ``` 7. **启动特定应用**: - 若要启动特定的应用,如联系人应用的某个特定...

    android开发使用例子

    Intent it = new Intent(Intent.ACTION_SENDTO, uri); 3. it.putExtra("sms_body", "The SMS text"); 4. startActivity(it); 发送彩信 1. Uri uri = Uri.parse("content://media/external/images/media/23"); ...

    android Intent指南

    例如,发送短信可以使用`Intent it = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:0800000123")); it.putExtra("sms_body", "The SMS text"); startActivity(it);`,而发送彩信则需要附带一个多媒体内容Uri...

    Android常用的intent action汇总

    15. Intent.ACTION_SENDTOString: android.intent.action.SENDTO发送数据到特定的URI,常用于发送邮件。16. Intent.ACTION_VIEWString: android.intent.action.VIEW查看数据,例如打开文件、查看地图位置等。17. ...

    intent的几种常用用法.pdf

    Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", "The SMS text"); startActivity(it); ``` 6. **发送彩信(MMS)** 需要包含多媒体内容,使用`ACTION_SEND`,并设置`EXTRA_...

    Android开发技巧15个.pdf

    - 使用`Intent.ACTION_SENDTO`启动意图,结合`Uri.fromParts()`创建短信URI,并通过`putExtra()`添加短信内容。最后调用`startActivity()`发送短信。 5. **发送彩信**: - 发送彩信与发送短信类似,但需要添加...

    android资料积累

    8. **调用发邮件**:`ACTION_SENDTO`用于启动邮件客户端,指定邮件地址。 ```java Uri emailUri = Uri.parse("mailto:shenrenkui@gmail.com"); Intent returnIt = new Intent(Intent.ACTION_SENDTO, emailUri); ```...

Global site tag (gtag.js) - Google Analytics