From ad7774a9c0bd3e55e9a801b000610b667213f9d1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 8 Oct 2019 14:10:06 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/data/entities/RssArticle.kt | 2 +- .../main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt index c9d7edcf7..e3810036f 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt @@ -10,7 +10,7 @@ import androidx.room.Ignore ) data class RssArticle( var origin: String = "", - var title: String? = "", + var title: String = "", var order: Long = 0, var author: String? = null, var link: String? = null, diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt index 7310b819f..db4191674 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt @@ -16,8 +16,10 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) { fun initData(intent: Intent) { execute { - intent.getStringExtra("guid")?.let { - val rssArticle = App.db.rssArtivleDao().get(it) + val origin = intent.getStringExtra("origin") + val title = intent.getStringExtra("title") + if (origin != null && title != null) { + val rssArticle = App.db.rssArtivleDao().get(origin, title) if (rssArticle != null) { if (!rssArticle.description.isNullOrBlank()) { contentLiveData.postValue(rssArticle.description)