android 分享功能


1.    分享文字:

       Intent intent=new Intent(Intent.ACTION_SEND);  
intent.setType("text/plain");  
intent.putExtra(Intent.EXTRA_SUBJECT,“这是标题”);  
intent.putExtra(Intent.EXTRA_TEXT,"这是分享的内容");  
startActivity(Intent.createChooser(intent, getTitle())); 



2. 给指定的用户发送邮件:

Uri mUri = Uri.parse("mailto:");
Intent intent = new Intent(Intent.ACTION_SEND, mUri);
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { "
填写接收邮件的邮箱" });
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT,"测试邮件标题");
intent.putExtra(Intent.EXTRA_TEXT,"
邮件的内容");
intent.putExtra(Intent.EXTRA_CC, new String[] { "" });
this.startActivity(intent);

      


你可能感兴趣的:(android,String,测试,email)