public
void
SystemShare(String
text
, Uri
uri
){
//系统自带的分享,会通过你安装的软件,已列表方式显示出来,选择自己想要的分享方式
try
{
Intent
intent
=
new
Intent(
"android.intent.action.SEND"
);
intent
.setType(
"image/*"
);
intent
.putExtra(Intent.
EXTRA_TEXT
,
text
);
intent
.putExtra(Intent.
EXTRA_STREAM
,
uri
);
intent
.putExtra(Intent.
EXTRA_SUBJECT
,
"分享到···"
);
intent
.putExtra(
"Kdescription"
,
text
);
startActivity(Intent. createChooser(
intent
,
"分享到···"
));
}
catch
(Exception
e
) {
Toast. makeText(MainActivity.
this
,
"SystemShare error"
, Toast.
LENGTH_SHORT
).show();
}
}
public
void
ShareWeibo(String
text
, Uri
uri
){
//分享到新浪微博
try
{
Intent
intent
=
new
Intent(
"android.intent.action.SEND"
);
ComponentName
comp
=
new
ComponentName(
"com.sina.weibo"
,