Am using sdcard for saving data ,my problem is that when app is running and some one delete this folder then the application fail. Is there anyway to notify the app , when this folder get deleted ?. Please help me
Try like this.
Answer:
Try like this.
private static File logFile = null;
String SD_CARD_PATH = Environment.getExternalStorageDirectory().toString();
logFile = new File(SD_CARD_PATH + "/" + "folderName");
if (logFile.exists()){
//exist.so do your work
}
else{
//not exists
}
thanks now its working
ReplyDelete