This is my code
public class MainActivity extends Activity {
@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_main);
initControls ();
}
private void initControls () {
TextView tv = (TextView) findViewById (R.id.tv);
String linkText = "";
try {
Document doc = Jsoup.connect ("http://210.34.148.183:8080/test/kebiao.htm") get ();.
Element element = doc.getElementById ("ctl00_ContentPlaceHolder3_ScheduleTable");
Elements target = element.getElementsByTag ("td");
for (Element link: target) {
linkText + = link.text () + "\ n";
}
} Catch (IOException e) {
e.printStackTrace ();
}
tv.setText (linkText);
}
}
activity_main.xml there is only one textview, the code is not an error, but when the phone is running on has not show up. Seeking answers!<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
No comments:
Post a Comment