2013-07-29 2 views
0

나는 문자열Android의 html 문자열에서 불필요한 문자를 극복 하시겠습니까? RSS 피드에

public void setEncodedContent(String encodedContent) { 
    //this.encodedContent = encodedContent; 
    String noHTMLString = encodedContent.replaceAll("\\<.*?>",""); 
    this.encodedContent = noHTMLString; 
} 

의 HTML 문자를이 표시되지 않도록 다음과 같은 일을 오전하지만 같은 문자를 수신하고

& # 8211 & # 8217 & # 그것을 극복하는 방법은 무엇입니까 8221

?

감사합니다.

+0

당신은 필요한 태그를 분석하기 위해 xml pull parser를 사용할 수 있습니다. – Raghunandan

+0

나는 내 자신의 질문에 해결책을 추가했습니다. 도와 주신 모든 분들께 감사드립니다. – user45678

답변

0

이것은 저에게 효과적입니다. 희망은 독자에게 도움이 될 것입니다.

public void setEncodedContent(String encodedContent) { 
//this.encodedContent = encodedContent; 
String noHTMLString = encodedContent.replaceAll("\\<.*?>",""); 
String yesHTMLString= Html.fromHtml(noHTMLString).toString(); 
this.encodedContent = yesHTMLString; 

} 
관련 문제