Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Java
- Eclipse
- 안드로이드
- Bootstrap
- asp.net
- 웹 서비스
- Android
- jsp
- MANTIS
- 컬럼명
- TextBox
- Apache Lucene
- Web Service
- C#
- MSsql
- WebView
- 자바스크립트
- varags
- 자바
- 이클립스
- javascript
- SpringSource Tool Suite
- scrollView
- STS
- html
- MS-SQL
- Maven
- decompiler
- Redirect
- 웹뷰
Archives
- Today
- Total
bboks.net™
이미지를 url을 통해 load 하기 본문
1. 이미지를 load하는 asynctask 추가
private class DownloadImageTask extends AsyncTask{ ImageView bmImage; public DownloadImageTask(ImageView bmImage) { this.bmImage = bmImage; } protected Bitmap doInBackground(String... urls) { String urldisplay = urls[0]; Bitmap mIcon11 = null; try { InputStream in = new java.net.URL(urldisplay).openStream(); mIcon11 = BitmapFactory.decodeStream(in); } catch (Exception e) { Log.e("Error", e.getMessage()); e.printStackTrace(); } return mIcon11; } protected void onPostExecute(Bitmap result) { bmImage.setImageBitmap(result); } }
2. ListView의 getView에서 호출
new DownloadImageTask(imageView).execute("url.....");
[출처] Load image from url