private void share(String content, Uri uri){ spa
Intent shareIntent = new Intent(Intent.ACTION_SEND); it
if(uri!=null){ im
shareIntent.putExtra(Intent.EXTRA_STREAM, uri); margin
shareIntent.setType("image/*"); di
//當用戶選擇短信時使用sms_body取得文字 vi
shareIntent.putExtra("sms_body", content); co
}else{ background
shareIntent.setType("text/plain"); new
} void
shareIntent.putExtra(Intent.EXTRA_TEXT, content);
//自定義選擇框的標題
//startActivity(Intent.createChooser(shareIntent, "邀請好友"));
//系統默認標題
startActivity(shareIntent);
}