I'm using the following code to save an image to a folder when I select an option:
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
String filename = "teste.png";
File file = new File(path, filename);
filename = file.toString();
Highgui.imwrite(filename, mRgba);
But i'd like the saved image to NOT OVERWRITE the image that's already in the folder. How could I do that? Using a kind of index for each image or something like that, I think, but how?
Thanks.