Delay calling setHasOptionsMenu() to avoid a crash in Wifi Settings
If it is called in onCreate(), it's too early for Wifi Settings, which does its initialization in onActivityCreated(). Change-Id: I3d9b49f63d342e724fd4795fbca48d08faa3c3cc
This commit is contained in:
@@ -55,15 +55,15 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
|
||||
int helpResource = getHelpResource();
|
||||
if (helpResource != 0) {
|
||||
mHelpUrl = getResources().getString(helpResource);
|
||||
if (!TextUtils.isEmpty(mHelpUrl)) {
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
if (!TextUtils.isEmpty(mHelpUrl)) {
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user