From 56ba339f23b41386337ae173818409b5210d1216 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 19 Oct 2020 21:46:48 +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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 db221bede..e14f0035a 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 @@ -191,10 +191,10 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), override fun getItem(position: Int): Fragment { return when (getId(position)) { - 0 -> BookshelfFragment() - 1 -> ExploreFragment() - 2 -> RssFragment() - else -> MyFragment() + 0 -> fragmentMap[0] ?: BookshelfFragment() + 1 -> fragmentMap[1] ?: ExploreFragment() + 2 -> fragmentMap[2] ?: RssFragment() + else -> fragmentMap[3] ?: MyFragment() } }