我正在尝试捕获页面的文本,然后将其显示在我的应用程序中。但是当我运行程序时不显示文本。该网站是 http://www.bovalpo.com/cgi-local/xml_bcv.pl?URL=1
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_examplebackground);
try {
URL url = new URL("http://www.bovalpo.com/cgi-local/xml_bcv.pl?URL=1");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine="";
String inputText = "";
while ((inputLine = in.readLine()) != null) {
inputText = inputText + inputLine;
}
System.out.println(inputText);
}catch(MalformedURLException t){
System.out.println("error de url");
} catch(Throwable t){
System.out.println("error de bufffer");
}
}