我與模擬器一起工作,嘗試從網站獲取文本。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