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 2abe33fd..bf3977bb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt @@ -26,10 +26,12 @@ class ReadTextActivity : SimpleActivity() { private fun checkIntent() { read_text_view.setTextColor(config.textColor) val uri = intent.data - if (uri.scheme == "file") { - read_text_view.text = File(uri.path).readText() + val text = if (uri.scheme == "file") { + File(uri.path).readText() } else { - read_text_view.text = contentResolver.openInputStream(uri).bufferedReader().use { it.readText() } + contentResolver.openInputStream(uri).bufferedReader().use { it.readText() } } + + read_text_view.setText(text) } } diff --git a/app/src/main/res/layout/activity_read_text.xml b/app/src/main/res/layout/activity_read_text.xml index a197d992..e04cdf36 100644 --- a/app/src/main/res/layout/activity_read_text.xml +++ b/app/src/main/res/layout/activity_read_text.xml @@ -5,11 +5,13 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> -