diff --git a/Android/app/src/main/AndroidManifest.xml b/Android/app/src/main/AndroidManifest.xml index bb792079d..96e24cb5a 100644 --- a/Android/app/src/main/AndroidManifest.xml +++ b/Android/app/src/main/AndroidManifest.xml @@ -17,7 +17,8 @@ android:icon="@drawable/icon" android:label="@string/app_name" android:banner="@drawable/banner" - android:theme="@style/Theme.Project64" > + android:theme="@style/Theme.Project64" + android:requestLegacyExternalStorage="true" > outNames, List outPaths ) { if( !startPath.exists() ) + { return; - - if( startPath.isFile() ) + } + + if(startPath.isFile()) + { startPath = startPath.getParentFile(); - - if( startPath.getParentFile() == null ) + } + + if(startPath.getParentFile() == null) + { includeParent = false; + } outNames.clear(); outPaths.clear(); if( includeParent ) { - - outNames.add( Html.fromHtml( ".." ) ); - boolean BaseDir = false; - ArrayList StorageDirectories = AndroidDevice.getStorageDirectories(); + outNames.add( Html.fromHtml( ".." ) ); + boolean BaseDir = false; + ArrayList StorageDirectories = AndroidDevice.getStorageDirectories(); for( String directory : StorageDirectories ) { - if (TextUtils.equals(startPath.getPath(), directory)) - { - BaseDir = true; - break; - } + if (TextUtils.equals(startPath.getPath(), directory)) + { + BaseDir = true; + break; + } } - outPaths.add( BaseDir ? null : startPath.getParentFile().getPath() ); } - if( includeDirectories ) + if(includeDirectories) { for( File directory : getContents( startPath, new VisibleDirectoryFilter() ) ) { @@ -58,7 +62,7 @@ public final class FileUtil } } - if( includeFiles ) + if(includeFiles) { for( File file : getContents( startPath, new VisibleFileFilter() ) ) { @@ -71,9 +75,9 @@ public final class FileUtil public static List getContents( File startPath, FileFilter fileFilter ) { // Get a filtered, sorted list of files - List results = new ArrayList(); + List results = new ArrayList<>(); File[] files = startPath.listFiles( fileFilter ); - + if( files != null ) { Collections.addAll( results, files );