diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt index 88192c4d..6b3724bd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt @@ -80,7 +80,13 @@ class ReadTextActivity : SimpleActivity() { val text = if (uri.scheme == "file") { filePath = uri.path - File(uri.path).readText() + val file = File(filePath) + if (file.exists()) { + file.readText() + } else { + toast(R.string.unknown_error_occurred) + "" + } } else { try { contentResolver.openInputStream(uri).bufferedReader().use { it.readText() } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index 45f76164..425fe68e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -95,7 +95,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList