pull/43/head^2
kunfei 5 years ago
parent 80ff827671
commit e116f4f1ef
  1. 5
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  2. 1
      app/src/main/res/values/strings.xml

@ -249,8 +249,11 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
} }
importSource -> if (resultCode == Activity.RESULT_OK) { importSource -> if (resultCode == Activity.RESULT_OK) {
data?.data?.let { data?.data?.let {
FileUtils.getPath(this, it)?.let { path -> val path = FileUtils.getPath(this, it)
if (path != null) {
viewModel.importSourceFromFilePath(path) viewModel.importSourceFromFilePath(path)
} else {
toast(R.string.uri_to_path_fail)
} }
} }
} }

@ -540,5 +540,6 @@
<string name="file_chooser">文件选择</string> <string name="file_chooser">文件选择</string>
<string name="folder_chooser">文件夹选择</string> <string name="folder_chooser">文件夹选择</string>
<string name="bottom_line">我是有底线的</string> <string name="bottom_line">我是有底线的</string>
<string name="uri_to_path_fail">Uri转Path失败</string>
</resources> </resources>

Loading…
Cancel
Save