146 |
|
|
147 |
File file = new File( SAVEDIR + data.getFilename() ); |
File file = new File( SAVEDIR + data.getFilename() ); |
148 |
|
|
149 |
if (saveImage == true) { |
/* if the picture changes later on the day we do NOT want to use an old and invalid image |
150 |
|
if (saveImage == true) { |
151 |
if (file.exists()) { |
if (file.exists()) { |
152 |
return BitmapFactory.decodeFile(file.getAbsolutePath()); |
return BitmapFactory.decodeFile(file.getAbsolutePath()); |
153 |
} |
} |
154 |
} |
}*/ |
155 |
|
|
156 |
byte imageData[] = HttpUtil.getContent(data.url, 2500); |
byte imageData[] = HttpUtil.getContent(data.url, 2500); |
157 |
|
|
159 |
File savedir = new File(SAVEDIR); |
File savedir = new File(SAVEDIR); |
160 |
savedir.mkdirs(); |
savedir.mkdirs(); |
161 |
|
|
162 |
|
if (file.exists()) { |
163 |
|
file.delete(); |
164 |
|
} |
165 |
|
|
166 |
FileOutputStream fos = new FileOutputStream(file); |
FileOutputStream fos = new FileOutputStream(file); |
167 |
fos.write(imageData); |
fos.write(imageData); |
168 |
fos.close(); |
fos.close(); |