안드로이드 개발 질문/답변
(글 수 45,052)
타이머 사용방법에 대해서 질문드립니다.
어떤 내용을 주기적으로 리프레쉬기능을 하려고 합니다.
고수님 조언 부탁드립니다. 꾸벅~~
void downloadFile(String fileUrl){
URL imgUrl;
Bitmap bm = null;
try {
imgUrl = new URL(fileUrl);
URLConnection conn = imgUrl.openConnection();
HttpURLConnection httpConn = (HttpURLConnection)conn;
InputStream in = httpConn.getInputStream();
bm = BitmapFactory.decodeStream(in);
imView.setImageBitmap(bm);
in.close();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
소스는 확인해보지 않았지만 주기적인 작업에서 핸들러 이용은 해보셨나요? 핸들러로 검색하면 관련된 글들 많이 있으니 참고하시기 바랍니다.