MediaScannerConnection#scanFile converts directories into files when accessing them with USB-MTP on Android 5 Lollipop
问题 Changes like renaming a file triggered by an app only appear to the USB-MTP interface after reboot of the Android device or after you registered the new file at the MediaScanner them like this (see Trigger mediascanner on specific path (folder), how to?): file.renameTo(newFile); MediaScannerConnection.scanFile(context, new String[] { newFile.getAbsolutePath() }, null, null); USB-MTP is used to access the storage of an android device via USB. E.g. with the Windows Explorer. However, with the