Update FileBrowserActivity.java

This commit is contained in:
ShirosakiMio 2024-03-25 08:15:44 +08:00
parent 5f35774a62
commit 0e9a2f9f55
1 changed files with 5 additions and 0 deletions

View File

@ -169,9 +169,14 @@ public class FileBrowserActivity extends FCLActivity implements View.OnClickList
} }
} }
if (view == openExternal) { if (view == openExternal) {
if (currentPath.toFile().getAbsolutePath().equals(Environment.getExternalStorageDirectory().getAbsolutePath())) {
return;
}
Uri uri = FileProvider.getUriForFile(this, getString(R.string.file_browser_provider), currentPath.toFile()); Uri uri = FileProvider.getUriForFile(this, getString(R.string.file_browser_provider), currentPath.toFile());
Intent intent = new Intent(Intent.ACTION_SEND); Intent intent = new Intent(Intent.ACTION_SEND);
intent.setDataAndType(uri, "*/*"); intent.setDataAndType(uri, "*/*");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
startActivity(intent); startActivity(intent);
} }
if (view == confirm) { if (view == confirm) {