ITeye博客

android 分享到微博

zheyiw · 2012-10-10 13:36 · Android · 移动开发 · Android · Markdown



	/**
	 * 分享到微博等
	 */
	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()));
	}


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。