分享时将标题文字设为粗体 [英] Make title text bold when sharing
本文介绍了分享时将标题文字设为粗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在这里,下面的代码将共享onclick的内容.通过其他应用共享内容时,有两种内容:一种是ti-标题,另一种是de-description.我想在共享时将标题设为粗体.有可能吗?
Here, the code below will share the content onclick. While sharing the content through other app there are two contents: one is ti - title, another is de - description. I want to make the title bold while sharing. Is that possible?
expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
TextView de = (TextView) v.findViewById(R.id.lblListItem);
TextView ti = (TextView) v.findViewById(R.id.lblListHeader);
String selected = ti.getText().toString() + de.getText().toString();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, selected);
startActivity(Intent.createChooser(intent, "Share via"));
return false;
}
});
推荐答案
如果您想在Whatsapp上共享任何内容,则有个小窍门,只需在任何文本的开头和结尾使用"*",然后在Whatsapp将显示为粗体.
If you want to share any thing on Whatsapp then there is small trick just use "*" in starting of any text and ending of the text then your text on Whatsapp will show bold.
final Intent intent = new Intent(android.content.Intent.ACTION_SEND);
String shareMessage = "*"+"Download theguruji app for more news\n\n"+"*";
intent.putExtra(Intent.EXTRA_TEXT, shareMessage);
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, "Share via"));
这篇关于分享时将标题文字设为粗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文