In the current app I’m developing user has privileged to add an image to the application. Image Uri (sd card location) will be saved in SQLite. Now the problem arises what if the user deletes the image in SD card and app trying to access it. Definitely that’ll be a force close. This is how we can check whether file exist or not before calling the image.
private Uri imgurl ="sdcard/1.jpg"; java.io.File file = new java.io.File(imgurl); if (file.exists()) { do your stuff here }
Subscribe to our mailing list
Subscribe to our mailing list and receive a free udpates
ramya says
Sir/mam
Now a days I can’t download for applications y any problem for downloading