mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-01-31 01:20:46 +01:00
DroidFish: Automatically create default directory structure on the SD card when starting the program.
This commit is contained in:
parent
865eab1f9b
commit
869f45334e
|
@ -178,6 +178,8 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
String pgn = getPgnIntent();
|
||||
|
||||
createDirectories();
|
||||
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
settings.registerOnSharedPreferenceChangeListener(new OnSharedPreferenceChangeListener() {
|
||||
|
@ -224,6 +226,15 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||
}
|
||||
}
|
||||
|
||||
/** Create directory structure on SD card. */
|
||||
private void createDirectories() {
|
||||
File extDir = Environment.getExternalStorageDirectory();
|
||||
String sep = File.separator;
|
||||
new File(extDir + sep + bookDir).mkdirs();
|
||||
new File(extDir + sep + pgnDir).mkdirs();
|
||||
new File(extDir + sep + engineDir).mkdirs();
|
||||
}
|
||||
|
||||
private String getPgnIntent() {
|
||||
String pgn = null;
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue
Block a user