Forum Stats

  • 3,840,085 Users
  • 2,262,564 Discussions
  • 7,901,146 Comments

Discussions

Delete image from application folder

Hello,

I want to delete an image from application folder. When i clicked an image, its get stored in this path: "file:///storage/emulated/0/Android/data/package name/cache/1400345667.jpg". I want to delete that image when my image successfully uploaded an image to server.

This code that i have tried:

     // imagepath2 is the path of my image

        if(imagePath2.length()>0)

        {

            File f = new File(imagePath2);

            if (f.exists()) {

                f.delete();

            }

        }

But it does not go in if condition.

So please help me out.

Regards,

Siddharth

Tagged: