private void share(String content, Uri uri){
        Intent shareIntent = new Intent(Intent.ACTION_SEND); 
        if(uri!=null){
            shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
            shareIntent.setType("image/*"); 
            //当用户选择短信时使用sms_body取得文字
            shareIntent.putExtra("sms_body", content);
        }else{
            shareIntent.setType("text/plain"); 
        }
        shareIntent.putExtra(Intent.EXTRA_TEXT, content);
        //自定义选择框的标题
        //startActivity(Intent.createChooser(shareIntent, "邀请好友"));
        //系统默认标题
        startActivity(shareIntent);
    }

使用android自带分享功能进行分享。

转载自:http://blog.csdn.net/spare_h/article/details/7236758#

相关文章:

  • 2022-01-02
  • 2021-06-19
  • 2022-12-23
  • 2021-11-25
  • 2021-10-26
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2022-01-31
  • 2021-12-12
  • 2021-12-06
相关资源
相似解决方案