2013-07-22 23 views
0

我想知道在Android中寫入和解析XML文件的最簡單方法是什麼。我的要求很簡單。示例文件將如下所示:如何解析android中的字符串響應?

<HTML> 
<HEAD> 
<TITLE>Network Error</TITLE> 
</HEAD> 
</HTML> 
+1

可能重複[安卓:解析HTML標籤JSON(http://stackoverflow.com/questions/5539168/android-parsing-html-tags-in-json) – g00dy

+0

httpPost.setEntity(新StringEntity (requestEnvelope)); \t \t \t \t HttpResponse httpResponse = httpClient.execute(httpPost); \t \t \t \t HttpEntity httpEntity = httpResponse.getEntity(); \t \t \t \t line = EntityUtils.toString(httpEntity); – Narasimha

+0

嗨goody行是字符串 – Narasimha

回答

1

我得到了我使用這個簡單的格式,它的做工精細,謝謝。

myTextView.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>")); 
+0

大家好,非常感謝你分享信息。 – Narasimha

0

SAX在解析android中的XML時總是最好的選擇。您可以使用教程SAX解析

參考:Click Here