question: public static boolean moveFile ( Context context , @ NonNull final File source , @ NonNull final File targetDir ) { File target = new File ( targetDir , source . getName ( ) ) ; boolean success = source . renameTo ( target ) ; if ( ! success ) { success = copyFile ( context , source , targetDir ) ; if ( success ) { success = deleteFile ( context , source ) ; } } return success ; }
target:  Move a file. The target file may even be on external SD card.