サーバーから画像を読み込んで ImageView に表示しようとしています
使った
ImageView imgView = (ImageView) findViewById(R.id.ivProduct);
Bitmap bitmap = null;
try {
URL urlImage = new URL(
"http://www.google.fr/intl/en_com/images/srpr/logo1w.png");
HttpURLConnection connection = (HttpURLConnection) urlImage
.openConnection();
InputStream inputStream = connection.getInputStream();
bitmap = BitmapFactory.decodeStream(inputStream);
imgView.setImageBitmap(bitmap);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}`
これはうまくいきましたが、サーバーに同じ画像をダウンロードして、URLを
http://localhost:9527/market_helper/img_products/logo1w.png
それは動かなかった。何が問題ですか ?