mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-06-26 00:29:27 +00:00
Pass Apple2Activity to out getExternalStorageDirectory() function
This commit is contained in:
parent
22914de79c
commit
d819220a07
|
@ -417,7 +417,7 @@ public class Apple2Activity extends Activity {
|
|||
/* ... */
|
||||
}
|
||||
|
||||
File storageDir = Apple2DisksMenu.getExternalStorageDirectory();
|
||||
File storageDir = Apple2DisksMenu.getExternalStorageDirectory(Apple2Activity.this);
|
||||
if (storageDir != null) {
|
||||
String storagePath = storageDir.getAbsolutePath();
|
||||
if (diskPath.contains(storagePath)) {
|
||||
|
|
|
@ -75,10 +75,10 @@ public class Apple2DisksMenu implements Apple2MenuView {
|
|||
}
|
||||
});
|
||||
|
||||
getExternalStorageDirectory();
|
||||
getExternalStorageDirectory(activity);
|
||||
}
|
||||
|
||||
public static File getExternalStorageDirectory() {
|
||||
public static File getExternalStorageDirectory(Apple2Activity activity) {
|
||||
|
||||
do {
|
||||
if (sExternalFilesDir != null) {
|
||||
|
@ -148,7 +148,7 @@ public class Apple2DisksMenu implements Apple2MenuView {
|
|||
|
||||
Log.d(TAG, "First time copying stuff-n-things out of APK for ease-of-NDK access...");
|
||||
|
||||
getExternalStorageDirectory();
|
||||
getExternalStorageDirectory(activity);
|
||||
|
||||
recursivelyCopyAPKAssets(activity, /*from APK directory:*/"disks", /*to location:*/new File(sDataDir, "disks").getAbsolutePath());
|
||||
recursivelyCopyAPKAssets(activity, /*from APK directory:*/"keyboards", /*to location:*/new File(sDataDir, "keyboards").getAbsolutePath());
|
||||
|
@ -463,7 +463,7 @@ public class Apple2DisksMenu implements Apple2MenuView {
|
|||
|
||||
Arrays.sort(files);
|
||||
|
||||
getExternalStorageDirectory();
|
||||
getExternalStorageDirectory(mActivity);
|
||||
final boolean includeExternalStoragePath = (sExternalFilesDir != null && isRootPath);
|
||||
final boolean includeDownloadsPath = (sDownloadFilesDir != null && isRootPath);
|
||||
final int offset = includeExternalStoragePath ? (includeDownloadsPath ? 2 : 1) : (includeDownloadsPath ? 1 : 0);
|
||||
|
|
|
@ -226,7 +226,7 @@ public class Apple2KeyboardSettingsMenu extends Apple2AbstractMenu {
|
|||
@Override
|
||||
public void handleSelection(final Apple2Activity activity, final Apple2AbstractMenu settingsMenu, boolean isChecked) {
|
||||
|
||||
File extKeyboardDir = Apple2DisksMenu.getExternalStorageDirectory();
|
||||
File extKeyboardDir = Apple2DisksMenu.getExternalStorageDirectory(activity);
|
||||
|
||||
FilenameFilter kbdJsonFilter = new FilenameFilter() {
|
||||
public boolean accept(File dir, String name) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user