Remove unnecessary intent creation
This commit is contained in:
parent
79d4782caf
commit
255cacbfd4
1 changed files with 16 additions and 27 deletions
|
|
@ -122,11 +122,7 @@ class ManageBlockedKeywordsActivity : SimpleActivity(), RefreshRecyclerViewListe
|
|||
|
||||
private fun tryImportBlockedKeywords() {
|
||||
if (isQPlus()) {
|
||||
Intent(Intent.ACTION_GET_CONTENT).apply {
|
||||
addCategory(Intent.CATEGORY_OPENABLE)
|
||||
val mimeType = "text/plain"
|
||||
type = mimeType
|
||||
|
||||
try {
|
||||
importActivityResultLauncher.launch(mimeType)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
|
|
@ -134,7 +130,6 @@ class ManageBlockedKeywordsActivity : SimpleActivity(), RefreshRecyclerViewListe
|
|||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
handlePermission(PERMISSION_READ_STORAGE) { isAllowed ->
|
||||
if (isAllowed) {
|
||||
|
|
@ -208,11 +203,6 @@ class ManageBlockedKeywordsActivity : SimpleActivity(), RefreshRecyclerViewListe
|
|||
private fun tryExportBlockedNumbers() {
|
||||
if (isQPlus()) {
|
||||
ExportBlockedKeywordsDialog(this, config.lastBlockedKeywordExportPath, true) { file ->
|
||||
Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
||||
type = "text/plain"
|
||||
putExtra(Intent.EXTRA_TITLE, file.name)
|
||||
addCategory(Intent.CATEGORY_OPENABLE)
|
||||
|
||||
try {
|
||||
exportActivityResultLauncher.launch(file.name)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
|
|
@ -224,7 +214,6 @@ class ManageBlockedKeywordsActivity : SimpleActivity(), RefreshRecyclerViewListe
|
|||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
handlePermission(PERMISSION_WRITE_STORAGE) { isAllowed ->
|
||||
if (isAllowed) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue