File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
app/src/main/kotlin/com/simplemobiletools/filemanager/activities Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11package com.simplemobiletools.filemanager.activities
22
33import android.os.Bundle
4+ import com.simplemobiletools.commons.extensions.toast
5+ import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
46import com.simplemobiletools.filemanager.R
57import com.simplemobiletools.filemanager.extensions.config
68import kotlinx.android.synthetic.main.activity_read_text.*
@@ -11,6 +13,17 @@ class ReadTextActivity : SimpleActivity() {
1113 super .onCreate(savedInstanceState)
1214 setContentView(R .layout.activity_read_text)
1315
16+ handlePermission(PERMISSION_WRITE_STORAGE ) {
17+ if (it) {
18+ checkIntent()
19+ } else {
20+ toast(R .string.no_storage_permissions)
21+ finish()
22+ }
23+ }
24+ }
25+
26+ private fun checkIntent () {
1427 read_text_view.setTextColor(config.textColor)
1528 val uri = intent.data
1629 if (uri.scheme == " file" ) {
You can’t perform that action at this time.
0 commit comments