ネットから何らかのURLから画像を取得し、ImageViewに表示したいと思います。以下は私が使用しているコードです:-
Bitmap bm = null;
try {
URL aURL = new URL("stringURL");
URLConnection conn = aURL.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
}catch (Exception e) {
// TODO: handle exception
}
iv.setImageBitmap(bm);
しかし、私は画像を取得できません