I am trying to create a directory in internal storage for my app. Following is the code I am using to check if the directory exists or not. If the directory already exists, it is returned; else, the directory is created and returned. But even in the subsequent calls to the method, the exists() call on the directory always return false. What is the reason? Thanks
public File getMessageVoiceDirectory() {
File messageVoiceDirectory = this.myContext.getDir("Voice",Context.MODE_PRIVATE);
if (messageVoiceDirectory.exists() == false) {
messageVoiceDirectory.mkdirs();
}
return messageVoiceDirectory;
}