이미지 파일을 url을 이용해서 다운받고
임시 저장해서 bitmap으로 불러오려고 합니다
근데 어떤식으로 해야할지 난감하네요 ~
방향제시만 해주시면 감사하겠습니다 ~
final String dest = m_context.getCacheDir( ).getPath( ) + obj.getString( "instNum" ) + ".jpg" ; // 캐시폴더에 데이터 담는다. File imgFile = new File( dest ) ; if( imgFile.exists( ) ) /// 이미 받은적 있으면 그대로 사용한다. { Bitmap bmp = BitmapFactory.decodeFile( dest ) ; iv.setImageBitmap( bmp ) ; } else /// 없으면 다운받는다. { gsDownloader downloader = new gsDownloader( m_context, obj.getString( "imgHost" ) + obj.getString( "imgUrl" ), dest ) { @Override public void onLoad( ) { Bitmap bmp = BitmapFactory.decodeFile( dest ) ; iv.setImageBitmap( bmp ) ; } } ; downloader.start( ) ; }
로그인 유지
final String dest = m_context.getCacheDir( ).getPath( ) + obj.getString( "instNum" ) + ".jpg" ; // 캐시폴더에 데이터 담는다. File imgFile = new File( dest ) ; if( imgFile.exists( ) ) /// 이미 받은적 있으면 그대로 사용한다. { Bitmap bmp = BitmapFactory.decodeFile( dest ) ; iv.setImageBitmap( bmp ) ; } else /// 없으면 다운받는다. { gsDownloader downloader = new gsDownloader( m_context, obj.getString( "imgHost" ) + obj.getString( "imgUrl" ), dest ) { @Override public void onLoad( ) { Bitmap bmp = BitmapFactory.decodeFile( dest ) ; iv.setImageBitmap( bmp ) ; } } ; downloader.start( ) ; }