Android 프로그래밍을 배우고 있는데 실수였습니다.이미지 다운로드 URL
ImageView im = (ImageView) findViewById(R.id.imageView);
try {
URL u = new URL("http");
HttpURLConnection ur = (HttpURLConnection) u.openConnection();
InputStream in = ur.getInputStream();
Bitmap bs = BitmapFactory.decodeStream(in);
im.setImageBitmap(bs);
in.close();
} catch (Exception e) {
e.printStackTrace();
}
LogCat을 사용하여 충돌과 관련된 Java 스택 추적을 검사하십시오. https://stackoverflow.com/questions/23353173/unfortunately-myapp-has-stopped-how-can-i-solve-this. 대부분의 경우, 'NetworkOnMainThreadException'을 사용하여 충돌하는 것을 발견 할 수 있습니다 : http://stackoverflow.com/questions/6343166/how-to-fix-android-os-networkonmiththreadexception – CommonsWare
http://stackoverflow.com/a/ 3090802/5915572 –