1:发送短信

String body=”this is mms demo”;
Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(”smsto”, number, null));
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true);
mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true);
startActivity(mmsintent);


2:发送彩信

StringBuilder sb = new StringBuilder();
sb.append(”file://”);
sb.append(fd.getAbsoluteFile());
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(”mmsto”, number, null));
// Below extra datas are all optional.
intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, subject);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, sb.toString());
intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, composeMode);
intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, exitOnSent);
startActivity(intent);


3:发送Mail

mime = “img/jpg”;
shareIntent.setDataAndType(Uri.fromFile(fd), mime);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(fd));
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.putExtra(Intent.EXTRA_TEXT, body);

转帖:http://hi.baidu.com/jiang_yy_jiang/blog/item/72191b00b7efa002738b6543.html

--------------------------------------------------------------------------------------------------------------------------------

windows上用eclipse开发和 使用unix环境开发是不一样的,windows上使用下面的就可以发送了,注意自己修改下。
Intent intent = new Intent(Intent.ACTION_SEND);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("address", phnumber);
intent.putExtra("compose_mode", false);
intent.putExtra("exit_on_sent", true);
intent.putExtra("subject", "彩信测试");
intent.putExtra("sms_body", "this is mms send auto ");
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/ima.jpg"));
intent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
intent.setType("image/jpeg");

startActivity(Intent.createChooser(intent,"Send MMS To"));

转帖:http://www.eoeandroid.com/thread-21150-1-1.html

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

发送邮件的时候:no application can perform this action 或者 没有应用程序可执行此操作,

如下代码可解决:

String mailId=(String)ContactUs.this.getString(R.string.contactus8); Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts( "mailto",mailId, null)); //emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{mailId}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,body); startActivity(emailIntent); 

转贴: http://www.coderanch.com/t/520651/Android/Mobile/no-application-perform-action-when

更多相关文章

  1. android点击系统通知Notification,进入指定的activity
  2. Android(安卓)SurfaceView使用示例(二)
  3. Android(安卓)下使用wpa_cli 连接 wifi
  4. Android(安卓)Studio在引用项目时使用JDK1.8的解决办法
  5. API 23 找不到 org.apache.http.HttpResponse;
  6. 安卓开发-HttpClient使用
  7. 箭头函数的基础使用
  8. NPM 和webpack 的基础使用
  9. Python list sort方法的具体使用

随机推荐

  1. android――资源目录
  2. 自己总结的目前Android通用的流行框架大
  3. kinect手势识别后,利用识别效果控制鼠标
  4. android JavaMail发送邮件(可发送附件)
  5. android 2.3安装
  6. android Installation error: INSTALL_FA
  7. Android(安卓)开发知识点总结
  8. TabLayout的使用及使用中的问题总结
  9. Android应用程序开发之requestWindowFeat
  10. Gradle构建的生命周期和其对象的理解