I'm doing a APP
working with images, I'm saving the images in the gallery to a folder
named imagensAPP
like this:
SaveImage:
public File saveImage() {
int imageNum = 0;
//SALVANDO EM IMAGENSAPP . . .
File imagesFolder = new File(Environment.getExternalStorageDirectory()+File.separator+"DCIM", "imagensAPP");
imagesFolder.mkdirs();
//NOME DA IMG . . .
String fileName = "Img_" + String.valueOf(imageNum) + ".png";
File output = new File(imagesFolder, fileName);
while (output.exists()){
imageNum++;
fileName = "Img_" + String.valueOf(imageNum) + ".png";
output = new File(imagesFolder, fileName);
}
try {
Bitmap bitmap = imagemFinalizada;
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 40, bytes);
FileOutputStream fo = new FileOutputStream(output);
fo.write(bytes.toByteArray());
fo.flush();
fo.close();
MediaScannerConnection.scanFile(Teste.this, new String[]{output.getAbsolutePath()}, null, null);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return output;
}
By GridView
or otherwise, how can I pull these images to show within APP
?