This is my code
private class DownloadWebpageTask extends AsyncTask<String, Void, String> {
protected String doInBackground(String...urls){
try{ return (String)downloadUrl((String)urls[0]); }
catch( IOException e){return "download fail"; }
}
protected void onPostExecute(String result){
String word ="";
int start = -1;
int end=-1;
String tag_start="<title>";
String tag_end= "</title>";
start = result.indexOf(tag_start);
if(start != -1){
end = result.indexOf(tag_end);
if(end != -1){
word=result.substring(start+tag_start.length(), end);
text.append("result : "+word+", start : "+start+" , end:"+end);
}
else
text.append("there is no data");
}
else
text.append("there is no data");
}
}
Its about parsing the web page. and then I got this error I don't know what is wrong could you help me?
Aucun commentaire:
Enregistrer un commentaire