Bom dia pessoal.
Tenho uma simples rotina que pega algumas imagens de um servidor meu.
No meu Galaxy S (2.3.3) funciona muito bem. Cada linha do ListView aparece com a imagem correspondente.
Porem, no Galaxy Nexus (4.0.4), toda hora alguma imagem não é “baixada”.
/** Get image from web. */
private Bitmap getRemoteImage(String strImage) throws Exception {
Bitmap bitmap = null;
try {
DefaultHttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(Utility.PATH_PRODUCT_IMAGE + strImage);
HttpResponse execute = client.execute(httpGet);
InputStream inputStream = execute.getEntity().getContent();
// Get image.
BufferedInputStream bis = new BufferedInputStream(inputStream);
bitmap = BitmapFactory.decodeStream(bis);
// Close connection.
bis.close();
} catch (Exception e) {
Log.e("Profile", "Erro ao resgatar imagem da web: "+e.getMessage());
throw e;
}
// Return bitmap.
return bitmap;
}
Pra cada linha da ListView, esse método é chamado. Já utilizei o URLConnection tbm e o comportamento é o mesmo.
Preciso fazer mais alguma configuração.
Abs