dkim0419 / SoundRecorder

A simple sound recording app implementing Material Design
GNU General Public License v3.0
1.49k stars 807 forks source link

Files are not shown in MTP unless I restart the device #50

Open turicas opened 8 years ago

turicas commented 8 years ago

Hello. First of all, thanks for the project! <3

I've recorded some audios but couldn't access them via MTP when plugged using USB to my computer until I reboot the phone.

There is a known Android bug related to exposing some files to MTP: depending on the way the app creates the file, it will appear via MTP only when the device is restarted (there are also other tricks you can do to solve the problem, check this thread).

It seems the bug was not fixed but there is a comment on the Android bug on Google Code saying that you can add the following code to fix the problem:

MediaScannerConnection.scanFile(this, new String[] { file.getAbsolutePath() }, null, null);
gaul commented 7 years ago

You can work around this issue via the recently-added sharing intent and some target like Dropbox.

gaul commented 7 years ago

@turicas I cannot reproduce these symptoms with #59 and a Nexus 5x running Android 7.0.

turicas commented 7 years ago

@andrewgaul hmm so what should we do? If I move the files using a file manager on Android to the SD card, I can see them on the computer.