I am trying to create folder in external storage through my app.
The problem is that things work fine and as expected, except the Nexus 5 phone. The issue is that folder is shown as file. But when the phone is restarted then it shows correctly as a folder.
I think media scanner is not working. So for that I called media scanner explicitly but its not being called. For that reason I did some research and found that its specified over Google docs that from 4.4.2 media scanner could not be called from all apps.
I need help because after running app and creating folder app could be restarted again and again.
Edit
There are no errors coming, but if you try to access the folder it says:
directory not found
After restarting phone it works. Creating directory code:
File folder = new File(Environment.getExternalStorageDirectory() + "/myfoldername");
boolean success = true;
if (!folder.exists()) {
success = folder.mkdirs();