mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 00:18:18 +00:00
switch base directory to media directory
This commit is contained in:
1 file changed
+11
-1
@@ -76,7 +76,17 @@ object LaunchUtils {
|
|||||||
* Returns the directory that Geode/the game should base itself off of.
|
* Returns the directory that Geode/the game should base itself off of.
|
||||||
*/
|
*/
|
||||||
fun getBaseDirectory(context: Context): File {
|
fun getBaseDirectory(context: Context): File {
|
||||||
return context.getExternalFilesDir("")!!
|
// deprecated, but seems to be the best choice of directory (i forced mat to test it)
|
||||||
|
// also, is getting the first item the correct choice here?? what do they mean
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
val dir = context.externalMediaDirs.first()
|
||||||
|
|
||||||
|
// prevent having resources added to system gallery
|
||||||
|
// accessing this file every time the directory is read may be a little wasteful...
|
||||||
|
val noMediaPath = File(dir, ".nomedia")
|
||||||
|
noMediaPath.createNewFile()
|
||||||
|
|
||||||
|
return dir
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSaveDirectory(context: Context): File {
|
fun getSaveDirectory(context: Context): File {
|
||||||
|
|||||||
Reference in new issue
Block a user