2012-08-23 91 views
0

我真的需要在Facebook牆貼的描述中添加一個換行符。有一個使用<center></center>標籤的黑客,但它不再工作。我使用Facebook的API爲Android:在Facebook牆貼的描述中換行

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

他們必須禁用它是有原因的,但它肯定煩。現在任何確實找到方法的人都會毫不猶豫地公開! – Kevin

回答

-1

這爲我工作:

StringBuilder messageData = new StringBuilder(title).append('\n') 
    .append('\n').append(message).append('\n').append('\n') 
    .append(description); 
// Message 
postParams.putString("message", messageData.toString());