catch Out Of Memory errors at opening files in the editor
This commit is contained in:
parent
22b331e535
commit
260da456c1
1 changed files with 3 additions and 0 deletions
|
@ -204,6 +204,9 @@ class ReadTextActivity : SimpleActivity() {
|
|||
} else {
|
||||
try {
|
||||
contentResolver.openInputStream(uri)!!.bufferedReader().use { it.readText() }
|
||||
} catch (e: OutOfMemoryError) {
|
||||
showErrorToast(e.toString())
|
||||
return@ensureBackgroundThread
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
finish()
|
||||
|
|
Loading…
Reference in a new issue