zheyiw 发表于 2013-1-30 04:07:52

android 分享到微博

/** * 分享到微博等 */void share() {Intent intent = new Intent(Intent.ACTION_SEND);intent.setType("text/plain"); // 纯文本/*图片分享it.setType("image/png");//添加图片File f = new File(Environment.getExternalStorageDirectory() +"/Pictures/2.png");Uri u = Uri.fromFile(f);it.putExtra(Intent.EXTRA_STREAM, u);*/StringBuffer sb = new StringBuffer();sb.append(getStr(R.string.company_short)).append(getStr(R.string.des_share_1));sb.append("\"").append(Comm.currentProduct.title).append("\"");sb.append(getStr(R.string.des_share_2)).append(" ").append(Comm.pWeb_homeURL);sb.append(Comm.pWeb_ProductDetail).append(Comm.currentProduct.value);intent.putExtra(Intent.EXTRA_SUBJECT, "");intent.putExtra(Intent.EXTRA_TEXT, sb.toString());startActivity(Intent.createChooser(intent, getTitle()));}
页: [1]
查看完整版本: android 分享到微博