pull/48/head
kunfei 5 years ago
parent 7a9169ae90
commit 1997fe7d34
  1. 2
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt

@ -56,7 +56,7 @@ class RssSourceEditViewModel(application: Application) : BaseViewModel(applicati
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager?
clipboard?.primaryClip?.let { clipboard?.primaryClip?.let {
if (it.itemCount > 0) { if (it.itemCount > 0) {
val json = it.getItemAt(0).text.toString() val json = it.getItemAt(0).text.toString().trim()
GSON.fromJsonObject<RssSource>(json)?.let { source -> GSON.fromJsonObject<RssSource>(json)?.let { source ->
sourceLiveData.postValue(source) sourceLiveData.postValue(source)
} ?: toast("格式不对") } ?: toast("格式不对")

Loading…
Cancel
Save