So I create a file in my app in a directory, i want to be able to get the file from my tablet by just connecting it to my laptop and getting the file from the directory but am having trouble. I remember reading somewhere that you have to restart your device and the file just magically appears in the directory and it worked! I don't want to have to restart my device every time, is there any way around this?
File emulatedStorage = Environment.getExternalStorageDirectory();
File directory = new File(emulatedStorage.getAbsolutePath()+"/logger");
//check if directory exists.
if(!directory.exists()){
directory.mkdirs();
}
//make file and write stuff to it etc...
so like I said the file shows up when i restart my tablet, any suggestions or explanations?