Hi All,
Call me insane but I just cannot get this to wrok. I have an image on my server, offcourse I can see this image in my webbrowser... In Androidmanifest I have the permission internet, in my main.xml I have the imageview advertisement, I have all the right classes in my import. What is wrong with this code ??? Please anybody help I go nuts over this... I allways get the IOexception...
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView chart = (ImageView) findViewById(R.id.advertisement);
Bitmap bmImg;
try {
URL chartUrl = new URL("http://www.freshsolutions.nl/android/advertenties/fiat.png");
HttpURLConnection conn= (HttpURLConnection)chartUrl.openConnection();
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
bmImg = BitmapFactory.decodeStream(is);
chart.setImageBitmap(bmImg);
} catch (IOException e) {
/* Reset to Default image on any error. */
}
}


