我与模拟器一起工作,尝试从网站获取文本。alertdialog的错误:“应用程序的主要活动有 意外停止,请重试”。从网站阅读文本
public void testr(View view) throws IOException, URISyntaxException
{
URL websiteurl = new URL("http://test...");
BufferedReader in = new BufferedReader(
new InputStreamReader(
websiteurl.openStream()));
String inputLine;
AlertDialog alertbox = new AlertDialog.Builder(this).create();
while ((inputLine = in.readLine()) != null)
alertbox.setMessage(inputLine.toString());
in.close();
alertbox.show();
}
后logcat的错误消息。 – kosa 2012-02-09 20:42:11