Use default dir when Directory Chooser returns null/user clicks "Choose default dir"

This commit is contained in:
Martin Fietz 2016-02-02 10:31:29 +01:00
parent b8f725c843
commit 15a1c3e9f8
1 changed files with 6 additions and 1 deletions

View File

@ -389,7 +389,12 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
requestCode == DirectoryChooserActivity.RESULT_CODE_DIR_SELECTED) {
String dir = data.getStringExtra(DirectoryChooserActivity.RESULT_SELECTED_DIR);
File path = new File(dir);
File path;
if(dir != null) {
path = new File(dir);
} else {
path = ui.getActivity().getExternalFilesDir(null);
}
String message = null;
final Context context= ui.getActivity().getApplicationContext();
if(!path.exists()) {