Url'den image alma
28.02.2014 - 07:50
Merhabalar, url'den image almaya çalışıyorum. Ancak null dönüyor.
main :
[code]donwloadImage down = new donwloadImage(); [/code]
[code] down.execute("http://img1.loadtr.com/k-417911-k%C4%B1zg%C4%B1n_ikonu.jpg"); // downloadImage asynctask extend etmiş bir sınıf. [/code]
downloadImage :
[code]
try{
URL url = new URL(params[0]);
HttpURLConnection connection= (HttpURLConnection)url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream inputStream = connection.getInputStream();
bitmap = BitmapFactory.decodeStream(inputStream);
imageView.setImageBitmap(bitmap);
}
[/code]
266
Görüntülenme
0 Beğeni