Android: Add requestLegacyExternalStorage

This commit is contained in:
zilmar 2023-11-30 15:29:36 +10:30
parent d0445eb5cc
commit da092545e6
3 changed files with 24 additions and 20 deletions

View File

@ -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" >
<activity
android:name="emu.project64.SplashActivity"
android:label="@string/SplashActivity_title"

View File

@ -4,7 +4,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
import emu.project64.R;
import emu.project64.jni.LanguageStringID;
import emu.project64.jni.NativeExports;
import emu.project64.jni.SettingsID;

View File

@ -20,20 +20,25 @@ public final class FileUtil
boolean includeFiles, List<CharSequence> outNames, List<String> outPaths )
{
if( !startPath.exists() )
{
return;
}
if(startPath.isFile())
{
startPath = startPath.getParentFile();
}
if(startPath.getParentFile() == null)
{
includeParent = false;
}
outNames.clear();
outPaths.clear();
if( includeParent )
{
outNames.add( Html.fromHtml( "<b>..</b>" ) );
boolean BaseDir = false;
ArrayList<String> StorageDirectories = AndroidDevice.getStorageDirectories();
@ -45,7 +50,6 @@ public final class FileUtil
break;
}
}
outPaths.add( BaseDir ? null : startPath.getParentFile().getPath() );
}
@ -71,7 +75,7 @@ public final class FileUtil
public static List<File> getContents( File startPath, FileFilter fileFilter )
{
// Get a filtered, sorted list of files
List<File> results = new ArrayList<File>();
List<File> results = new ArrayList<>();
File[] files = startPath.listFiles( fileFilter );
if( files != null )