Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Commit

Permalink
Try Fix #12602 java.lang.IllegalStateException
Browse files Browse the repository at this point in the history
  • Loading branch information
itning committed Feb 25, 2019
1 parent 6786081 commit 9cbd4bf
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,12 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
override fun onStart() {
val fragment = supportFragmentManager.findFragmentById(R.id.frame_container)
if (fragment == null || fragment is ClassScheduleFragment) {
supportFragmentManager
.beginTransaction()
.add(R.id.frame_container, fragmentSparseArray.get(R.id.nav_class_schedule))
.commitAllowingStateLoss()
if (supportFragmentManager.beginTransaction().isEmpty) {
supportFragmentManager
.beginTransaction()
.add(R.id.frame_container, fragmentSparseArray.get(R.id.nav_class_schedule))
.commitAllowingStateLoss()
}
}
//设置主标题
toolbar.title = ACTION_BAR_TITLE_FORMAT.format(Date())
Expand Down

0 comments on commit 9cbd4bf

Please sign in to comment.