- // Set the default download file path if the storage permission has not been granted.
- if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
+ // Set the initial file paths.
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { // The storage permission has been granted.
+ // Create a string for the external public path.
+ String EXTERNAL_PUBLIC_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + "/" + getString(R.string.privacy_browser_settings);
+
+ // Set the default path.
+ exportFileEditText.setText(EXTERNAL_PUBLIC_PATH);
+ importFileEditText.setText(EXTERNAL_PUBLIC_PATH);
+ } else { // The storage permission has not been granted.