/** * 分享到微博等 */ 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())); }
android 分享到微博
猜你喜欢
转载自zheyiw.iteye.com/blog/1695018
今日推荐
周排行