有很多时候我们需要分享应用中的信息到Facebook,Twitter,短信等。。
1创建一个Intent
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
2 分享内容的格式
sharingIntent.setType("text/plain");
3添加内容(短信或是Twitter有字数限制)
sharingIntent.putExtra(Intent.EXTRA_TEXT,"Here the body");
startActivity(Intent.createChooser(sharingIntent,"How do you want to share?"));