次の関数を使用して、リモート画像を ImageView に読み込みます。画像は、ロードしようとしている URL に確実に存在しますが、関数を呼び出して画像を表示しようとすると、ImageView は空白のままになります。
public static void setImage(ImageView view, String url) throws IOException {
final URLConnection conn = new URL(url).openConnection();
conn.connect();
final InputStream is = conn.getInputStream();
final BufferedInputStream bis = new BufferedInputStream(is, 100000);
final Bitmap bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
view.setImageBitmap(bm);
}