Here’s the code:
String folderPath = Environment.getExternalStorageDirectory() + "/AllAroundMe/Images";
File file = new File(folderPath);
if(!file.exists())
{
if(file.mkdirs());
Log.d("MyTag","Created folders succefully");
}
if(file.exists())
{
Log.d("MyTag", "folders exists: " + file.getAbsolutePath());
}
The second if never happens, and it should, because I make these dirs. What is wrong with my code?
BTW, everytime I run this program, it always goes in the first condition.
Make sure that you have
in your android.manifest file.
Also, it would be better to construct your
fileobject like this: