0

I have used an answer from here How should I give images rounded corners in Android?

However when created the picture with rounded edges it is being saved in my camera gallery as well as in a custom location that I have specified, any reason why this would happen or anyway to get rid of it automatically? I don't want a picture being saved here.

Community
  • 1
  • 1
Alex
  • 31
  • 1
  • 5

1 Answers1

0

Images are not saved in your device gallery - the gallery just displays all the images that are on your phone, UNLESS they are in storage associated with particular application. Use the following method do determine where you should save the images.

private File getAbosoluteFile(String ralativePath, Context context) {
    if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
        return new File(context.getExternalFilesDir(null), ralativePath);
    } else {
        return new File(context.getFilesDir(), ralativePath);
    }
}

It will store them in external storage associated with your application and they will seize being displayed in the device's gallery. Try this out with new image, because images are cached for a long time in the gallery application.

Boris Strandjev
  • 46,145
  • 15
  • 108
  • 135
  • @Alex: maybe a symlink? Furthermore the gallery app is caching in a different file the thumbnail to display - are you sure you are not talking about its path? – Boris Strandjev Jul 01 '13 at 18:03
  • MediaStore.Images.Media.insertImage(getContentResolver(),file.getAbsolutePath(),file.getName(),file.getName()); – Alex Jul 01 '13 at 18:05
  • @Alex think I may have found a rogue bit of code! ?? And what is the meaning of the second comment? – Boris Strandjev Jul 01 '13 at 18:09
  • That was being called after i saved the image. Must of been from something else i was trying. But aking it out has stopped issue. – Alex Jul 01 '13 at 18:11
  • Thanks for the quick reply though! Answer to this question is open your eyes! Always check over your code – Alex Jul 01 '13 at 18:16