mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 10:35:26 +00:00
setHasOptionsMenu() should be called from fragment's onCreate()
This commit is contained in:
parent
e1aabd70e8
commit
e9f04256c9
@ -11,6 +11,7 @@ import android.os.Bundle;
|
|||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -50,6 +51,13 @@ public class LogFragment extends Fragment {
|
|||||||
|
|
||||||
private MenuItem mClickedMenuItem;
|
private MenuItem mClickedMenuItem;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setHasOptionsMenu(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.log_fragment, container, false);
|
View view = inflater.inflate(R.layout.log_fragment, container, false);
|
||||||
@ -65,7 +73,6 @@ public class LogFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
setHasOptionsMenu(true);
|
|
||||||
new LogManager().read();
|
new LogManager().read();
|
||||||
getActivity().setTitle(R.string.log);
|
getActivity().setTitle(R.string.log);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,12 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
|
|||||||
private SearchView.OnQueryTextListener searchListener;
|
private SearchView.OnQueryTextListener searchListener;
|
||||||
private String lastFilter;
|
private String lastFilter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setHasOptionsMenu(true);
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
@ -89,7 +95,6 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
setHasOptionsMenu(true);
|
|
||||||
getActivity().setTitle(R.string.magiskhide);
|
getActivity().setTitle(R.string.magiskhide);
|
||||||
CallbackHandler.register(packageLoadDone, this);
|
CallbackHandler.register(packageLoadDone, this);
|
||||||
if (packageLoadDone.isTriggered) {
|
if (packageLoadDone.isTriggered) {
|
||||||
|
@ -47,8 +47,13 @@ public class ReposFragment extends Fragment implements CallbackHandler.EventList
|
|||||||
|
|
||||||
private SearchView.OnQueryTextListener searchListener;
|
private SearchView.OnQueryTextListener searchListener;
|
||||||
|
|
||||||
@Nullable
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setHasOptionsMenu(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.repos_fragment, container, false);
|
View view = inflater.inflate(R.layout.repos_fragment, container, false);
|
||||||
@ -106,7 +111,6 @@ public class ReposFragment extends Fragment implements CallbackHandler.EventList
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
setHasOptionsMenu(true);
|
|
||||||
CallbackHandler.register(repoLoadDone, this);
|
CallbackHandler.register(repoLoadDone, this);
|
||||||
getActivity().setTitle(R.string.downloads);
|
getActivity().setTitle(R.string.downloads);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user