0
I’m making a APP
who works with images, I’m saving the images in a gallery folder
called imagensAPP
in this way:
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;
}
For GridView
or otherwise, how can I pull these images to show inside the APP
?