Fixed options menus appearing on screens that they shouldn't

This commit is contained in:
Viktor De Pasquale 2019-04-18 16:00:54 +02:00
parent 7e5e14163c
commit f76015d714
3 changed files with 3 additions and 7 deletions

View File

@ -1,7 +1,5 @@
package com.topjohnwu.magisk.ui.home package com.topjohnwu.magisk.ui.home
import android.os.Bundle
import android.view.View
import com.skoumal.teanity.viewevents.ViewEvent import com.skoumal.teanity.viewevents.ViewEvent
import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.BuildConfig
import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.Config
@ -41,13 +39,9 @@ class MagiskFragment : NewMagiskFragment<HomeViewModel, FragmentMagiskBinding>()
} }
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setHasOptionsMenu(true)
}
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
setHasOptionsMenu(true)
requireActivity().setTitle(R.string.magisk) requireActivity().setTitle(R.string.magisk)
} }

View File

@ -43,6 +43,7 @@ public class SettingsFragment extends BasePreferenceFragment {
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
setHasOptionsMenu(true);
requireActivity().setTitle(R.string.settings); requireActivity().setTitle(R.string.settings);
} }

View File

@ -13,6 +13,7 @@ class SuperuserFragment :
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
setHasOptionsMenu(true)
requireActivity().setTitle(R.string.superuser) requireActivity().setTitle(R.string.superuser)
} }