adding some crashfixes
This commit is contained in:
parent
8ab1ae60ea
commit
c7ae139ad6
2 changed files with 11 additions and 1 deletions
|
@ -231,7 +231,12 @@ class ReadTextActivity : SimpleActivity() {
|
|||
filePath = uri.path!!
|
||||
val file = File(filePath)
|
||||
if (file.exists()) {
|
||||
file.readText()
|
||||
try {
|
||||
file.readText()
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
""
|
||||
}
|
||||
} else {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
""
|
||||
|
|
|
@ -11,6 +11,7 @@ import android.util.AttributeSet
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.commons.helpers.isOreoPlus
|
||||
import com.simplemobiletools.filemanager.pro.R
|
||||
import com.simplemobiletools.filemanager.pro.activities.MimeTypesActivity
|
||||
import com.simplemobiletools.filemanager.pro.activities.SimpleActivity
|
||||
|
@ -86,6 +87,10 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
|||
}
|
||||
|
||||
private fun getSizes() {
|
||||
if (!isOreoPlus()) {
|
||||
return
|
||||
}
|
||||
|
||||
ensureBackgroundThread {
|
||||
getMainStorageStats(context)
|
||||
|
||||
|
|
Loading…
Reference in a new issue