我真的需要在facebook wall post的描述中添加换行符。有一个使用<center></center>
标签的黑客攻击,但它不再起作用了。我正在使用Facebook API for Android:
public Bundle createFacebookMsg() {
Bundle params = new Bundle();
...
params.putString("description", "my custom string with LINE BREAKS");
// does not work any more
// params.putString("description", "line1<center></center>line2");
...
return params;
}
答案 0 :(得分:-1)
这对我有用:
StringBuilder messageData = new StringBuilder(title).append('\n')
.append('\n').append(message).append('\n').append('\n')
.append(description);
// Message
postParams.putString("message", messageData.toString());