currently I’m pulling text from a website using
public String getText(String uri) {
HttpClient client1 = new DefaultHttpClient();
HttpGet request = new HttpGet(uri);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
try {
String response_str = client1.execute(request, responseHandler);
return response_str;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "";
}
}
and I get a bunch of HTML code that is filtered with Html.fromHtml() which cleans up all the HTML text and leaves me with the dialog I want.
However this method cannot let me set the title of the alert dialog because it only comes out as one string and cannot differentiate between whats in the parameters from the <body></body> parameters. It also doesn’t filter out some comments such as
<!--BODY{color:white; background-color:transparent;......
How can I delete the extra HTML text and separate the title portion from the main body of the text. Thank You
Take a look at Spannable string class.