这个块既没有在日志中给出错误,也没有在字符串体中添加任何值
try {
int roll = 00111502713;
//url defined is completely fine//
URL url = new URL("someurl");
URLConnection con = url.openConnection();
InputStream in = con.getInputStream();
encoding = con.getContentEncoding();
encoding = encoding == null ? "UTF-8" : encoding;
try {
body = IOUtils.toString(in, encoding);
Toast.makeText(FirstActivity.this, "Body found", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Log.e("Log_tag", "Hahaha");
}
} catch (Exception ex) {
// System.out.println("This shouldn't have happened");
Log.e("Log_Tag", "Really?");
}
答案 0 :(得分:0)
你必须致电:
Toast.makeText(FirstActivity.this,"Body found",Toast.LENGTH_SHORT).show();