mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-17 19:35:36 -04:00
#2469 bug fixed
This commit is contained in:
parent
0a3acb04d0
commit
1dee36dde9
@ -28,11 +28,12 @@ import org.kiwix.kiwixmobile.core.R
|
||||
import org.kiwix.kiwixmobile.core.base.BaseFragment
|
||||
|
||||
abstract class CoreSettingsFragment : BaseFragment() {
|
||||
|
||||
private lateinit var prefsFragment: Fragment
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
prefsFragment = createPreferenceFragment()
|
||||
requireActivity().supportFragmentManager
|
||||
.beginTransaction().replace(R.id.content_frame, createPreferenceFragment())
|
||||
.beginTransaction().replace(R.id.content_frame, prefsFragment)
|
||||
.commit()
|
||||
setUpToolbar()
|
||||
}
|
||||
@ -52,4 +53,12 @@ abstract class CoreSettingsFragment : BaseFragment() {
|
||||
activity.supportActionBar!!.setHomeButtonEnabled(true)
|
||||
activity.supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
requireActivity().supportFragmentManager
|
||||
.beginTransaction()
|
||||
.remove(prefsFragment)
|
||||
.commit()
|
||||
super.onDestroyView()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user