From e116f4f1ef0d284aa6f0972b80174581c3ef00d4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 30 Oct 2019 15:26:43 +0800 Subject: [PATCH] up --- .../legado/app/ui/book/source/manage/BookSourceActivity.kt | 5 ++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index ec1359b63..20661274d 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -249,8 +249,11 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity } importSource -> if (resultCode == Activity.RESULT_OK) { data?.data?.let { - FileUtils.getPath(this, it)?.let { path -> + val path = FileUtils.getPath(this, it) + if (path != null) { viewModel.importSourceFromFilePath(path) + } else { + toast(R.string.uri_to_path_fail) } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b9d9f260a..dc4bb8af1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -540,5 +540,6 @@ 文件选择 文件夹选择 我是有底线的 + Uri转Path失败