public void ShareImage( String path, String Name )
{
File file = new File( path, Name );
Uri imageUri = Uri.fromFile(file);
Intent imageIntent = new Intent(Intent.ACTION_SEND);
imageIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
imageIntent.setType("image/*");
startActivity(Intent.createChooser(imageIntent, "分享到"));
}
public void ShareText( String Text )
{
Intent share_intent = new Intent();
share_intent.setAction(Intent.ACTION_SEND);//设置分享行为
share_intent.setType("text/plain");//设置分享内容的类型
share_intent.putExtra(Intent.EXTRA_TEXT, Text );//添加分享内容
//创建分享的Dialog
share_intent = Intent.createChooser(share_intent, "分享到");
startActivity(share_intent);
}