2012-10-04 112 views
0

把\ N值或
在(新行),我想了許多新的生產線或一些大膽的文字或也與一些超級鏈接如何BasicNameValuePair

例如發送消息:下面是我的代碼

List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1); 
    String model = Build.MODEL + ", " + Build.MANUFACTURER; 
    nameValuePairs.add(new BasicNameValuePair("message", "Your Last Alert: On "+mDate+" at "+mTime+", "+ model +" reported that its battery level was down to "+batteryLevel+". You might want to get it on a charger before it's too late! &nbsp;&nbsp Do you know where "+model+" is? </br></br> Click "+s+" to view in Google Maps.\n To find "+model+" with the Last Alert app on Android-phone, click here. \n\n\n\n\n\n Last Known Location : \n San Francisco California United States 94108"+"\n\n\n\n\n GPS Coordinates \n"+lat+", "+lon+"Altitude\n"+alt+"\n\nLocation Accuracy"+"16.40ft Diameter")); 

我已經使用&nbsp;空間,<br>爲新線新線也\n但問題是,消息在純文本只(我的Gmail中有哪些是我的帳戶發送郵件) 像下面發送

Your Last Alert: On 10/04/2012 at 03:23 pm, LG-P500, LGE reported that its battery level was down to 100. You might want to get it on a charger before it's too late! &nbsp Do you know where LG-P500, LGE is? Click https://maps.google.com/maps?q=0.0,0.0 to view in Google Maps. To find LG-P500, LGE with the Last Alert app on Android-phone, click here. Last Known Location : San Francisco California United States 94108 GPS Coordinates 0.0, 0.0Altitude -1.79769313486231E308 Location Accuracy16.40ft Diameter 
+0

你如何發送消息? – CodeCaster

回答

2

猜測..嘗試 「</br></br>」 與 「<br/><br/>」 代替。這可能會解決您的問題。

1
  1. 您是否設定在「內容類型」(在你的HTTP請求頭): text/html
  2. 包裝你的消息到<html>
  3. 使用<br/>標籤,而不是\n
+0

感謝您的建議:) –

+0

不客氣:) –

+0

我upvote你的答案! –