From 37a560eb3972ed755890fd85a58f050d20208a94 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 8 Feb 2020 10:38:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 9fda82311..3b4bbb859 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -38,6 +38,7 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), private var pagePosition = 0 private val fragmentList = arrayListOf() + private var rssFragment: RssFragment? = null override fun onActivityCreated(savedInstanceState: Bundle?) { ATH.applyEdgeEffectColor(view_pager_main) @@ -69,7 +70,8 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), fragmentList.add(MyFragment()) } if (AppConfig.isShowRSS && fragmentList.size < 4) { - fragmentList.add(2, RssFragment()) + fragmentList.add(2, + rssFragment ?: RssFragment().apply { rssFragment = this }) } if (!AppConfig.isShowRSS && fragmentList.size == 4) { fragmentList.removeAt(2)