pull/32/head
GKF 6 years ago
parent 23d53f9946
commit 385843dc06
  1. 5
      app/src/main/java/io/legado/app/ui/main/myconfig/MyConfigFragment.kt

@ -14,7 +14,10 @@ class MyConfigFragment : BaseFragment(R.layout.fragment_my_config) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
setSupportToolbar(toolbar) setSupportToolbar(toolbar)
childFragmentManager.beginTransaction().add(R.id.pre_fragment, PreferenceFragment()).commit() val fragmentTag = "prefFragment"
var preferenceFragment = childFragmentManager.findFragmentByTag(fragmentTag)
if (preferenceFragment == null) preferenceFragment = PreferenceFragment()
childFragmentManager.beginTransaction().replace(R.id.pre_fragment, preferenceFragment, fragmentTag).commit()
} }
override fun onCompatCreateOptionsMenu(menu: Menu) { override fun onCompatCreateOptionsMenu(menu: Menu) {

Loading…
Cancel
Save